aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/src/sort.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-23 13:51:20 -0700
committerFuwn <[email protected]>2021-05-23 13:51:20 -0700
commitddce4052e84962b10ee18a3d395ba5f8edeb3fff (patch)
tree7c57e6aa0fd346e540d974e08a099180739afa40 /crates/whirl_common/src/sort.rs
parentbuild(cargo): create a fast builds configuration for cargo (diff)
downloadwhirl-ddce4052e84962b10ee18a3d395ba5f8edeb3fff.tar.xz
whirl-ddce4052e84962b10ee18a3d395ba5f8edeb3fff.zip
docs(global): add new documentation
Diffstat (limited to 'crates/whirl_common/src/sort.rs')
-rw-r--r--crates/whirl_common/src/sort.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/whirl_common/src/sort.rs b/crates/whirl_common/src/sort.rs
index 131fa55..b1b79b2 100644
--- a/crates/whirl_common/src/sort.rs
+++ b/crates/whirl_common/src/sort.rs
@@ -1,6 +1,8 @@
// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective
// SPDX-License-Identifier: GPL-3.0-only
+/// Sort a vector by alphabetical order based on the first character of each
+/// string.
pub fn sort_vec_alphabetically(vec: &mut Vec<&str>) {
vec.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()));
}