diff --git a/src/string.rs b/src/string.rs index 636c725..264d51f 100644 --- a/src/string.rs +++ b/src/string.rs @@ -174,7 +174,7 @@ impl Eq for String {} impl PartialOrd for String { fn partial_cmp(&self, other: &String) -> Option { - self.as_bytes().partial_cmp(&other.as_bytes()) + Some(self.cmp(other)) } } diff --git a/tests/conversion.rs b/tests/conversion.rs index e61dd32..0bad495 100644 --- a/tests/conversion.rs +++ b/tests/conversion.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; -use std::ffi::{CStr, CString, OsStr, OsString}; -use std::path::{Path, PathBuf}; +use std::ffi::{CStr, CString, OsString}; +use std::path::PathBuf; use bstr::BString; use maplit::{btreemap, btreeset, hashmap, hashset};