cargo fix --edition-idioms

This commit is contained in:
Simon Sapin 2018-11-01 21:43:04 +01:00
parent b1fd6237d1
commit 2012be4a8b
203 changed files with 665 additions and 1281 deletions

View file

@ -44,25 +44,25 @@ impl CSSRule {
}
}
pub fn as_specific(&self) -> &SpecificCSSRule {
pub fn as_specific(&self) -> &dyn SpecificCSSRule {
if let Some(rule) = self.downcast::<CSSStyleRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSFontFaceRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSKeyframesRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSMediaRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSNamespaceRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSViewportRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSKeyframeRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSImportRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else if let Some(rule) = self.downcast::<CSSSupportsRule>() {
rule as &SpecificCSSRule
rule as &dyn SpecificCSSRule
} else {
unreachable!()
}