aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_common/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-03 15:37:20 +0000
committerFuwn <[email protected]>2024-06-03 15:37:20 +0000
commit967774fc048b9d0738fbd13998ed77b6b70effa2 (patch)
treee0f9d650a221476852005eeaac96224584a3a76a /crates/whirl_common/src
parentformat: rustfmt with new rules (diff)
downloadwhirl-967774fc048b9d0738fbd13998ed77b6b70effa2.tar.xz
whirl-967774fc048b9d0738fbd13998ed77b6b70effa2.zip
refactor(crates): update idioms
Diffstat (limited to 'crates/whirl_common/src')
-rw-r--r--crates/whirl_common/src/log.rs2
-rw-r--r--crates/whirl_common/src/sort.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/whirl_common/src/log.rs b/crates/whirl_common/src/log.rs
index 38248cf..98aba50 100644
--- a/crates/whirl_common/src/log.rs
+++ b/crates/whirl_common/src/log.rs
@@ -15,7 +15,7 @@ pub fn calculate_log_level() -> String {
_ => "info".to_string(),
};
if !Config::get().whirlsplash.log.everything {
- level = format!("whirl={}", level);
+ level = format!("whirl={level}");
}
level
diff --git a/crates/whirl_common/src/sort.rs b/crates/whirl_common/src/sort.rs
index 9c7e092..c8b9cae 100644
--- a/crates/whirl_common/src/sort.rs
+++ b/crates/whirl_common/src/sort.rs
@@ -3,6 +3,6 @@
/// 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()));
+pub fn vec_alphabetically(vec: &mut [&str]) {
+ vec.sort_by_key(|a| a.to_lowercase());
}