diff --git a/src/atrule/media.rs b/src/atrule/media.rs index c624061..d0507ea 100644 --- a/src/atrule/media.rs +++ b/src/atrule/media.rs @@ -47,6 +47,7 @@ impl MediaQuery { } } + #[allow(clippy::if_not_else)] fn merge(&self, other: &Self) -> MediaQueryMergeResult { let this_modifier = self.modifier.as_ref().map(|m| m.to_ascii_lowercase()); let this_type = self.media_type.as_ref().map(|m| m.to_ascii_lowercase()); @@ -91,12 +92,12 @@ impl MediaQuery { if negative_features .iter() - .all(|feat| positive_features.contains(&feat)) + .all(|feat| positive_features.contains(feat)) { return MediaQueryMergeResult::Empty; - } else { - return MediaQueryMergeResult::Unrepresentable; } + + return MediaQueryMergeResult::Unrepresentable; } else if self.matches_all_types() || other.matches_all_types() { return MediaQueryMergeResult::Unrepresentable; } @@ -173,7 +174,7 @@ impl MediaQuery { return MediaQueryMergeResult::Empty; } else { if this_modifier.is_some() { - modifier = &this_modifier + modifier = &this_modifier; } else { modifier = &other_modifier; } diff --git a/tests/color.rs b/tests/color.rs index 42a7b90..57c9654 100644 --- a/tests/color.rs +++ b/tests/color.rs @@ -788,3 +788,8 @@ test!( "a {\n color: mix(rgba(255, 20, 0, 0), rgba(0, 20, 255, 1), 100);\n}\n", "a {\n color: rgba(255, 20, 0, 0);\n}\n" ); +test!( + hue_largest_channel_is_blue, + "a {\n color: hue(rgb(1, 2, 5));\n}\n", + "a {\n color: 225deg;\n}\n" +);