Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Resolve incorrect_partial_ord_impl_on_ord_type clippy lint
Browse files Browse the repository at this point in the history
    warning: incorrect implementation of `partial_cmp` on an `Ord` type
       --> src/value/tagged.rs:150:1
        |
    150 | /  impl PartialOrd for Tag {
    151 | |      fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        | | _____________________________________________________________-
    152 | ||         Some(Ord::cmp(self, other))
    153 | ||     }
        | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
    154 | |  }
        | |__^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
        = note: `-W clippy::incorrect-partial-ord-impl-on-ord-type` implied by `-W clippy::all`
  • Loading branch information
dtolnay committed Jul 18, 2023
1 parent da99545 commit c1b1eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/value/tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl Ord for Tag {

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

Expand Down

0 comments on commit c1b1eac

Please sign in to comment.