From 0ba6253eedc02a7bf4c94e7c6210cc50ffc59ed7 Mon Sep 17 00:00:00 2001 From: Irevoire Date: Wed, 26 Oct 2022 14:32:19 +0200 Subject: [PATCH] fix the sort --- dump/src/writer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/src/writer.rs b/dump/src/writer.rs index 789930bd1..026c653f7 100644 --- a/dump/src/writer.rs +++ b/dump/src/writer.rs @@ -219,13 +219,13 @@ pub(crate) mod test { let (aft, bft) = (a.file_type().unwrap(), b.file_type().unwrap()); if aft.is_dir() && bft.is_dir() { - a.file_name().into_string().unwrap().cmp(&b.file_name().into_string().unwrap()) - } else if aft.is_file() { + a.file_name().cmp(&b.file_name()) + } else if aft.is_file() && bft.is_dir() { std::cmp::Ordering::Greater - } else if bft.is_file() { + } else if bft.is_file() && aft.is_dir() { std::cmp::Ordering::Less } else { - a.file_name().into_string().unwrap().cmp(&b.file_name().into_string().unwrap()) + a.file_name().cmp(&b.file_name()) } });