Skip to content

Commit

Permalink
Fix clippy warning in PartialOrd impl (#132)
Browse files Browse the repository at this point in the history
This seems to be a relatively new warning when using Rust nightly.

Signed-off-by: Tej Chajed <[email protected]>
  • Loading branch information
tchajed authored Jul 21, 2023
1 parent 3ed310a commit fe60f99
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions inference/src/subsume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ pub trait SubsumptionMap: Clone + Send + Sync {
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Reversed<O: OrderSubsumption>(O);

impl<O: OrderSubsumption> PartialOrd for Reversed<O> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.leq_cmp(other))
}
}

impl<O: OrderSubsumption> Ord for Reversed<O> {
fn cmp(&self, other: &Self) -> Ordering {
self.leq_cmp(other)
}
}

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

impl<O: OrderSubsumption> OrderSubsumption for Reversed<O> {
type Base = O::Base;
type Map<V: Clone + Send + Sync> = ReversedSubsumptionMap<O::Map<V>>;
Expand Down Expand Up @@ -187,7 +187,7 @@ impl<O: OrderSubsumption> AndLike<O> {

impl<O: OrderSubsumption> PartialOrd for AndLike<O> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.leq_cmp(other))
Some(self.cmp(other))
}
}

Expand Down Expand Up @@ -489,7 +489,7 @@ pub struct Pair<O1: OrderSubsumption, O2: OrderSubsumption>(O1, O2);

impl<O1: OrderSubsumption, O2: OrderSubsumption> PartialOrd for Pair<O1, O2> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.leq_cmp(other))
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit fe60f99

Please sign in to comment.