diff options
| author | Fuwn <[email protected]> | 2024-06-03 15:37:20 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-03 15:37:20 +0000 |
| commit | 967774fc048b9d0738fbd13998ed77b6b70effa2 (patch) | |
| tree | e0f9d650a221476852005eeaac96224584a3a76a /crates/whirl_common | |
| parent | format: rustfmt with new rules (diff) | |
| download | whirl-967774fc048b9d0738fbd13998ed77b6b70effa2.tar.xz whirl-967774fc048b9d0738fbd13998ed77b6b70effa2.zip | |
refactor(crates): update idioms
Diffstat (limited to 'crates/whirl_common')
| -rw-r--r-- | crates/whirl_common/src/log.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_common/src/sort.rs | 4 |
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()); } |