Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings/errors #436

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions partiql-value/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,7 @@ impl PartialEq for List {

impl PartialOrd for List {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
let mut l = self.0.iter();
let mut r = other.0.iter();

loop {
match (l.next(), r.next()) {
(None, None) => return Some(Ordering::Equal),
(Some(_), None) => return Some(Ordering::Greater),
(None, Some(_)) => return Some(Ordering::Less),
(Some(lv), Some(rv)) => match lv.partial_cmp(rv) {
None => return None,
Some(Ordering::Less) => return Some(Ordering::Less),
Some(Ordering::Greater) => return Some(Ordering::Greater),
Some(Ordering::Equal) => continue,
},
}
}
Comment on lines -186 to -201
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having both Ord and PartialOrd implemented (with a non-default implementation) results in a clippy error: https://rust-lang.github.io/rust-clippy/master/index.html#/incorrect_partial_ord_impl_on_ord_type

Some(self.cmp(other))
}
}

Expand Down
10 changes: 2 additions & 8 deletions partiql/benches/bench_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,8 @@ fn create_tests() -> Vec<(String, String)> {
.clone()
.map(|(&a, d)| create_query(vec![(a, *d)].as_slice(), false, false));

let aggs_all = aggs
.into_iter()
.cartesian_product([false].into_iter())
.collect_vec();
let aggs_distinct = aggs
.into_iter()
.cartesian_product([true].into_iter())
.collect_vec();
let aggs_all = aggs.into_iter().cartesian_product([false]).collect_vec();
let aggs_distinct = aggs.into_iter().cartesian_product([true]).collect_vec();

let full_aggs_all = groups
.clone()
Expand Down
Loading