We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a6064c commit 1b217f4Copy full SHA for 1b217f4
libs/sheet/src/theme.rs
@@ -683,8 +683,6 @@ impl Theme {
683
themes: &BTreeMap<String, BTreeMap<String, TokenValues>>,
684
breakpoints: &[u16],
685
) {
686
- use std::cmp::Ordering;
687
-
688
if themes.is_empty() {
689
return;
690
}
@@ -700,13 +698,9 @@ impl Theme {
700
698
let mut sorted_variants: Vec<_> = themes.iter().collect();
701
699
let dk = &default_key;
702
sorted_variants.sort_by(|a, b| {
703
- if a.0 == dk {
704
- return Ordering::Less;
705
- }
706
- if b.0 == dk {
707
- return Ordering::Greater;
708
709
- a.0.cmp(b.0)
+ let ad = a.0 == dk;
+ let bd = b.0 == dk;
+ if ad || bd { bd.cmp(&ad) } else { a.0.cmp(b.0) }
710
});
711
712
for (variant_name, token_theme) in &sorted_variants {
0 commit comments