Fix all 16 clippy warnings

- Collapse else { if } blocks into else if (6 instances)
- Replace map_or(false, ...) with is_some_and(...) (6 instances)
- Replace iter().cloned().collect() with .to_vec() (2 instances)
- Replace manual char comparison with array pattern (1 instance)
- Replace useless vec! with array literal (1 instance)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-27 23:58:18 +00:00
parent 766614f5e9
commit 112f18582a
5 changed files with 62 additions and 76 deletions

View File

@@ -215,7 +215,7 @@ pub fn load_themes() -> Vec<ThemeData> {
.filter(|e| {
e.path()
.extension()
.map_or(false, |ext| ext == "toml")
.is_some_and(|ext| ext == "toml")
})
.collect();
entries.sort_by_key(|e| e.file_name());
@@ -248,7 +248,7 @@ pub fn load_themes() -> Vec<ThemeData> {
/// Convert a filename stem like "tokyo-night" or "rose_pine" to "Tokyo Night" or "Rose Pine"
fn titlecase_filename(s: &str) -> String {
s.split(|c: char| c == '-' || c == '_')
s.split(['-', '_'])
.filter(|w| !w.is_empty())
.map(|word| {
let mut chars = word.chars();