From 18dadef0dd39bf3e57450fbf4a7098688fb81df0 Mon Sep 17 00:00:00 2001 From: DarkKronicle Date: Sun, 14 Jan 2024 14:43:45 -0700 Subject: [PATCH] Use unstable sort --- src/freedesktop.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedesktop.rs b/src/freedesktop.rs index 3d776c2..0a71a2e 100644 --- a/src/freedesktop.rs +++ b/src/freedesktop.rs @@ -642,7 +642,7 @@ struct MountPoint { fn get_sorted_mount_points() -> Result, Error> { // Returns longest mount points first let mut mount_points = get_mount_points()?; - mount_points.sort_by(|a, b| b.mnt_dir.as_os_str().as_bytes().len().cmp(&a.mnt_dir.as_os_str().as_bytes().len())); + mount_points.sort_unstable_by(|a, b| b.mnt_dir.as_os_str().as_bytes().len().cmp(&a.mnt_dir.as_os_str().as_bytes().len())); Ok(mount_points) }