Skip to content

Commit

Permalink
Make Stylesheet::is_effective_for_device more idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
nerith committed Nov 17, 2015
1 parent 6a28d62 commit 7f75a88
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions components/style/stylesheets.rs
Expand Up @@ -148,10 +148,7 @@ impl Stylesheet {
///
/// Always true if no associated MediaQueryList exists.
pub fn is_effective_for_device(&self, device: &Device) -> bool {
match self.media {
Some(ref media) => media.evaluate(device),
None => true
}
self.media.as_ref().map_or(true, |ref media| media.evaluate(device))
}

/// Return an iterator over all the rules within the style-sheet.
Expand Down

0 comments on commit 7f75a88

Please sign in to comment.