Update string tests

This commit is contained in:
Alex Orlenko
2024-10-16 15:58:52 +01:00
parent 7535a23fa2
commit 9e16e18132
2 changed files with 22 additions and 2 deletions
+9
View File
@@ -172,6 +172,15 @@ impl PartialEq for String {
impl Eq for String {}
impl<T> PartialOrd<T> for String
where
T: AsRef<[u8]> + ?Sized,
{
fn partial_cmp(&self, other: &T) -> Option<cmp::Ordering> {
self.as_bytes().partial_cmp(&other.as_ref())
}
}
impl PartialOrd for String {
fn partial_cmp(&self, other: &String) -> Option<cmp::Ordering> {
Some(self.cmp(other))