aboutsummaryrefslogtreecommitdiff
path: root/src/utils/sort.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/sort.rs')
-rw-r--r--src/utils/sort.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/sort.rs b/src/utils/sort.rs
new file mode 100644
index 0000000..131fa55
--- /dev/null
+++ b/src/utils/sort.rs
@@ -0,0 +1,6 @@
+// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
+// SPDX-License-Identifier: GPL-3.0-only
+
+pub fn sort_vec_alphabetically(vec: &mut Vec<&str>) {
+ vec.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()));
+}