mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
fix the sort
This commit is contained in:
parent
e8cd571820
commit
0ba6253eed
@ -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().into_string().unwrap().cmp(&b.file_name().into_string().unwrap())
|
a.file_name().cmp(&b.file_name())
|
||||||
} else if aft.is_file() {
|
} else if aft.is_file() && bft.is_dir() {
|
||||||
std::cmp::Ordering::Greater
|
std::cmp::Ordering::Greater
|
||||||
} else if bft.is_file() {
|
} else if bft.is_file() && aft.is_dir() {
|
||||||
std::cmp::Ordering::Less
|
std::cmp::Ordering::Less
|
||||||
} else {
|
} else {
|
||||||
a.file_name().into_string().unwrap().cmp(&b.file_name().into_string().unwrap())
|
a.file_name().cmp(&b.file_name())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user