Sort naturally

This commit is contained in:
Jeremy Soller 2024-01-05 09:48:39 -07:00
parent b9f0510b5d
commit e3bc82f0f3
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
3 changed files with 18 additions and 1 deletions

16
Cargo.lock generated
View file

@ -205,6 +205,12 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "any_ascii"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
[[package]] [[package]]
name = "apply" name = "apply"
version = "0.3.0" version = "0.3.0"
@ -1026,6 +1032,7 @@ dependencies = [
"i18n-embed-fl", "i18n-embed-fl",
"ignore", "ignore",
"lazy_static", "lazy_static",
"lexical-sort",
"libcosmic", "libcosmic",
"log", "log",
"notify", "notify",
@ -3076,6 +3083,15 @@ dependencies = [
"static_assertions", "static_assertions",
] ]
[[package]]
name = "lexical-sort"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c09e4591611e231daf4d4c685a66cb0410cc1e502027a20ae55f2bb9e997207a"
dependencies = [
"any_ascii",
]
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.151" version = "0.2.151"

View file

@ -10,6 +10,7 @@ env_logger = "0.10.0"
grep = "0.3.1" grep = "0.3.1"
ignore = "0.4.21" ignore = "0.4.21"
lazy_static = "1.4.0" lazy_static = "1.4.0"
lexical-sort = "0.3.1"
log = "0.4.20" log = "0.4.20"
patch = "0.7.0" patch = "0.7.0"
notify = "6.1.1" notify = "6.1.1"

View file

@ -88,7 +88,7 @@ impl Ord for ProjectNode {
} }
} }
} }
self.name().cmp(other.name()) lexical_sort::natural_lexical_cmp(self.name(), other.name())
} }
} }