diff --git a/src/string.rs b/src/string.rs index 1c76193..907032d 100644 --- a/src/string.rs +++ b/src/string.rs @@ -156,7 +156,7 @@ impl Ord for KStringBase { impl PartialOrd for KStringBase { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - self.as_str().partial_cmp(other.as_str()) + Some(self.cmp(other)) } } diff --git a/src/string_cow.rs b/src/string_cow.rs index 75a35db..627e5da 100644 --- a/src/string_cow.rs +++ b/src/string_cow.rs @@ -204,7 +204,7 @@ impl<'s, B: crate::backend::HeapStr> Ord for KStringCowBase<'s, B> { impl<'s, B: crate::backend::HeapStr> PartialOrd for KStringCowBase<'s, B> { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - self.as_str().partial_cmp(other.as_str()) + Some(self.cmp(other)) } } diff --git a/src/string_ref.rs b/src/string_ref.rs index 8683b8a..4e373f0 100644 --- a/src/string_ref.rs +++ b/src/string_ref.rs @@ -141,7 +141,7 @@ impl<'s> Ord for KStringRef<'s> { impl<'s> PartialOrd for KStringRef<'s> { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - self.as_str().partial_cmp(other.as_str()) + Some(self.cmp(other)) } }