]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make clippy shut up about `PartialOrd` and `Ord` both impl'd 2023-10-make-clippy-shut-up
authorMatt Corallo <git@bluematt.me>
Thu, 5 Oct 2023 23:57:08 +0000 (23:57 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 6 Oct 2023 00:02:45 +0000 (00:02 +0000)
Clippy gets mad that we have an implementation of `ParialOrd` and
`Ord` separately, even though both are identical. Making
`ParitalOrd` call `Ord` makes clippy shut up.

lightning-invoice/src/lib.rs

index 9695d79036ecc6a776e9ab10e340f0a94a7463d1..d953795cf8e061157f1c69e9c5bc5eae2b743ca6 100644 (file)
@@ -504,7 +504,7 @@ pub struct Bolt11InvoiceSignature(pub RecoverableSignature);
 
 impl PartialOrd for Bolt11InvoiceSignature {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-               self.0.serialize_compact().1.partial_cmp(&other.0.serialize_compact().1)
+               Some(self.cmp(other))
        }
 }