diff options
| author | Fuwn <[email protected]> | 2021-05-16 17:14:50 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-16 17:14:50 +0000 |
| commit | 8bb76b285937b602df055dd241fd86d2be966380 (patch) | |
| tree | 3e6dd57397e4280be2b1c163697b59632052fa5b /src/utils | |
| parent | refactor(builtins): help from individual printlns to vec iterable println (diff) | |
| download | whirl-8bb76b285937b602df055dd241fd86d2be966380.tar.xz whirl-8bb76b285937b602df055dd241fd86d2be966380.zip | |
perf(builtins): help commands to constants
This commit also reorders all helpables by alpabetical order.
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/mod.rs | 1 | ||||
| -rw-r--r-- | src/utils/sort.rs | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs index f5069fc..dc9a008 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -2,4 +2,5 @@ // SPDX-License-Identifier: GPL-3.0-only pub mod log; +pub mod sort; pub mod system; 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())); +} |