Resolve incorrect_partial_ord_impl_on_ord_type clippy lint

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`
This commit is contained in:
David Tolnay 2023-07-17 21:10:56 -07:00
parent da99545d4b
commit c1b1eac970
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 1 additions and 1 deletions

View File

@ -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))
}
}