diff --git a/crates/webclaw-core/src/brand.rs b/crates/webclaw-core/src/brand.rs index 6b874e7..52eb1b7 100644 --- a/crates/webclaw-core/src/brand.rs +++ b/crates/webclaw-core/src/brand.rs @@ -427,7 +427,7 @@ fn extract_colors(decls: &[CssDecl]) -> Vec { .collect(); // 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 let mut assigned_primary = colors.iter().any(|c| c.usage == ColorUsage::Primary); @@ -615,7 +615,7 @@ fn extract_fonts(decls: &[CssDecl]) -> Vec { } 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() }