mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Make Stylesheet::is_effective_for_device more idiomatic
This commit is contained in:
parent
6a28d62b15
commit
7f75a881a4
1 changed files with 1 additions and 4 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue