aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/src/sort.rs
blob: 9c7e092f382d2909d6da4b2eddf0e4a6dc4ed1d5 (plain) (blame)
1
2
3
4
5
6
7
8
// Copyright (C) 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 vec_alphabetically(vec: &mut Vec<&str>) {
  vec.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()));
}