mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
try to convert the OsStr to a rust string to fix the sort
This commit is contained in:
parent
4f955e68b3
commit
e8cd571820
@ -219,13 +219,13 @@ pub(crate) mod test {
|
|||||||
let (aft, bft) = (a.file_type().unwrap(), b.file_type().unwrap());
|
let (aft, bft) = (a.file_type().unwrap(), b.file_type().unwrap());
|
||||||
|
|
||||||
if aft.is_dir() && bft.is_dir() {
|
if aft.is_dir() && bft.is_dir() {
|
||||||
a.file_name().cmp(&b.file_name())
|
a.file_name().into_string().unwrap().cmp(&b.file_name().into_string().unwrap())
|
||||||
} else if aft.is_file() {
|
} else if aft.is_file() {
|
||||||
std::cmp::Ordering::Greater
|
std::cmp::Ordering::Greater
|
||||||
} else if bft.is_file() {
|
} else if bft.is_file() {
|
||||||
std::cmp::Ordering::Less
|
std::cmp::Ordering::Less
|
||||||
} else {
|
} else {
|
||||||
a.file_name().cmp(&b.file_name())
|
a.file_name().into_string().unwrap().cmp(&b.file_name().into_string().unwrap())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user