Skip to content

Commit

Permalink
chore: take clippy lints on partial compares
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre committed Jul 18, 2024
1 parent 096c65b commit 728564e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/client_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,7 @@ impl PartialEq for Strategy {
}
impl PartialOrd for Strategy {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
match self.sort_order.partial_cmp(&other.sort_order) {
Some(core::cmp::Ordering::Equal) => self.name.partial_cmp(&other.name),
Some(s) => Some(s),
None => self.name.partial_cmp(&other.name),
}
Some(self.cmp(other))
}
}
impl Ord for Strategy {
Expand Down Expand Up @@ -292,7 +288,7 @@ pub struct StrategyVariant {

impl PartialOrd for Variant {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.name.partial_cmp(&other.name)
Some(self.cmp(other))
}
}
impl Ord for Variant {
Expand All @@ -317,7 +313,7 @@ impl PartialEq for Segment {

impl PartialOrd for Segment {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.id.partial_cmp(&other.id)
Some(self.cmp(other))
}
}

Expand Down Expand Up @@ -424,7 +420,7 @@ impl Upsert for ClientFeatures {

impl PartialOrd for ClientFeature {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.name.partial_cmp(&other.name)
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 728564e

Please sign in to comment.