mirror of
https://github.com/0xMassi/webclaw.git
synced 2026-04-25 00:06:21 +02:00
chore(brand): fix clippy 1.95 unnecessary_sort_by errors
Pre-existing sort_by calls in brand.rs became hard errors under clippy 1.95. Switch to sort_by_key with std::cmp::Reverse. Pure refactor — same ordering, no behavior change. Bundled here so CI goes green on the P0 command-injection fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9645239fe8
commit
63e94af2e7
1 changed files with 2 additions and 2 deletions
|
|
@ -427,7 +427,7 @@ fn extract_colors(decls: &[CssDecl]) -> Vec<BrandColor> {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Sort by frequency (descending)
|
// Sort by frequency (descending)
|
||||||
colors.sort_by(|a, b| b.count.cmp(&a.count));
|
colors.sort_by_key(|c| std::cmp::Reverse(c.count));
|
||||||
|
|
||||||
// Promote top non-white/black to Primary/Secondary if they're still Unknown
|
// Promote top non-white/black to Primary/Secondary if they're still Unknown
|
||||||
let mut assigned_primary = colors.iter().any(|c| c.usage == ColorUsage::Primary);
|
let mut assigned_primary = colors.iter().any(|c| c.usage == ColorUsage::Primary);
|
||||||
|
|
@ -615,7 +615,7 @@ fn extract_fonts(decls: &[CssDecl]) -> Vec<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut fonts: Vec<(String, usize)> = freq.into_iter().collect();
|
let mut fonts: Vec<(String, usize)> = freq.into_iter().collect();
|
||||||
fonts.sort_by(|a, b| b.1.cmp(&a.1));
|
fonts.sort_by_key(|f| std::cmp::Reverse(f.1));
|
||||||
fonts.into_iter().map(|(name, _)| name).collect()
|
fonts.into_iter().map(|(name, _)| name).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue