Skip to content

Commit

Permalink
clippy & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jpschorr committed Mar 7, 2025
1 parent 7152b45 commit ae2e149
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
5 changes: 2 additions & 3 deletions extension/partiql-extension-ion/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::common::{
TIME_PARTS_TZ_HOUR, TIME_PARTS_TZ_MINUTE,
};
use std::num::NonZeroU8;
use std::ptr::read;
use std::rc::Rc;
use std::str::FromStr;
use thiserror::Error;
Expand Down Expand Up @@ -647,7 +646,7 @@ impl PartiqlEncodedIonValueDecoder {
reader.step_out()?;

let id = id.ok_or_else(err)?;
let labels = labels.unwrap_or_else(|| Default::default());
let labels = labels.unwrap_or_else(Default::default);
Ok((id, labels, payload))
}

Expand Down Expand Up @@ -757,7 +756,7 @@ impl PartiqlEncodedIonValueDecoder {
reader.step_out()?;

let id = id.ok_or_else(err)?;
let labels = labels.unwrap_or_else(|| Default::default());
let labels = labels.unwrap_or_else(Default::default);
let ends = ends.ok_or_else(err)?;
Ok((id, labels, ends, payload))
}
Expand Down
2 changes: 0 additions & 2 deletions extension/partiql-extension-ion/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ use partiql_extension_ion::boxed_ion::BoxedIonType;
use partiql_extension_ion::decode::{IonDecodeResult, IonDecoderBuilder, IonDecoderConfig};
use partiql_extension_ion::encode::{IonEncodeError, IonEncoderBuilder, IonEncoderConfig};
use partiql_extension_ion::Encoding;
use partiql_value::boxed_variant::BoxedVariantType;
use partiql_value::datum::{
Datum, DatumCategory, DatumCategoryOwned, DatumCategoryRef, DatumLower, OwnedFieldView,
OwnedSequenceView, OwnedTupleView, RefSequenceView, RefTupleView, SequenceDatum, TupleDatum,
};
use partiql_value::Value::Variant;
use partiql_value::{Bag, BindingsName, EqualityValue, NullableEq, Value};
use std::collections::HashMap;
use std::fs::File;
Expand Down
4 changes: 1 addition & 3 deletions partiql-logical-planner/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ impl Function for FunctionEntry<'_> {
fn resolve(&self, name: &str, args: &[CallArgument]) -> Result<ValueExpr, CallLookupError> {
let oid = self.id();
match self.entry() {
FunctionEntryFunction::Table(tbl) => {
tbl.call_def().lookup(args, name).map_err(Into::into)
}
FunctionEntryFunction::Table(tbl) => tbl.call_def().lookup(args, name),
FunctionEntryFunction::Scalar(scfn) => {
ScalarFnResolver { oid, scfn }.resolve(name, args)
}
Expand Down
11 changes: 4 additions & 7 deletions partiql-value/src/graph.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::graph::Graph::Simple;
use crate::{Tuple, Value};
use crate::Value;
use lasso::{Key, Rodeo, RodeoReader, Spur};
use petgraph::{Directed, Undirected};
#[cfg(feature = "serde")]
Expand Down Expand Up @@ -124,7 +123,7 @@ impl SimpleGraph {
assert_eq!(ids.len(), labels.len());
assert_eq!(ids.len(), ends.len());
assert_eq!(ids.len(), values.len());
for ((((id, labels), edge_spec), value)) in ids
for (((id, labels), edge_spec), value) in ids
.into_iter()
.zip(labels.into_iter())
.zip(ends.into_iter())
Expand All @@ -143,10 +142,9 @@ impl SimpleGraph {
let e = match edge_spec {

Check warning on line 142 in partiql-value/src/graph.rs

View workflow job for this annotation

GitHub Actions / clippy

unused variable: `e`

warning: unused variable: `e` --> partiql-value/src/graph.rs:142:17 | 142 | let e = match edge_spec { | ^ help: if this is intentional, prefix it with an underscore: `_e`
EdgeSpec::Directed(l, r) => {
let mut get_or_insert = |idx: GNodeId| {
directed_contains
*directed_contains
.entry(idx)
.or_insert_with_key(|idx| directed.add_node(idx.clone()))
.clone()
};
let lidx = GNodeId(node_ids.get(l).expect("expected node").into_usize());
let ridx = GNodeId(node_ids.get(r).expect("expected node").into_usize());
Expand All @@ -156,10 +154,9 @@ impl SimpleGraph {
}
EdgeSpec::Undirected(l, r) => {
let mut get_or_insert = |idx: GNodeId| {
undirected_contains
*undirected_contains
.entry(idx)
.or_insert_with_key(|idx| undirected.add_node(idx.clone()))
.clone()
};
let lidx = GNodeId(node_ids.get(l).expect("expected node").into_usize());
let ridx = GNodeId(node_ids.get(r).expect("expected node").into_usize());
Expand Down
2 changes: 1 addition & 1 deletion partiql-value/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ordered_float::OrderedFloat;
use std::borrow::Cow;
use std::fmt::{Debug, Display, Formatter, Pointer};
use std::fmt::{Debug, Display, Formatter};
use std::hash::Hash;

use rust_decimal::Decimal as RustDecimal;
Expand Down

0 comments on commit ae2e149

Please sign in to comment.