style: Trivially cleanup length parsing.

Mostly formatting signatures properly, but also removing useless functions and
stuff.
This commit is contained in:
Emilio Cobos Álvarez 2018-02-16 15:58:13 +01:00
parent a6113af873
commit fdc8405330
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 43 additions and 37 deletions

View file

@ -113,6 +113,12 @@ impl<'a> ParserContext<'a> {
}
}
/// Whether we're in a @page rule.
#[inline]
pub fn in_page_rule(&self) -> bool {
self.rule_type.map_or(false, |rule_type| rule_type == CssRuleType::Page)
}
/// Get the rule type, which assumes that one is available.
pub fn rule_type(&self) -> CssRuleType {
self.rule_type.expect("Rule type expected, but none was found.")