diff --git a/src/string.rs b/src/string.rs index 38548bd..63bfbc4 100644 --- a/src/string.rs +++ b/src/string.rs @@ -126,7 +126,14 @@ impl Ord for IString { } } -impl_cmp_as_str!(PartialOrd::); +// Manual implementation of PartialOrd that uses Ord to ensure it is consistent, as +// recommended by clippy. +impl PartialOrd for IString { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + impl_cmp_as_str!(PartialOrd::); impl_cmp_as_str!(PartialOrd::); impl_cmp_as_str!(PartialOrd::);