diff --git a/components/style/gecko/restyle_damage.rs b/components/style/gecko/restyle_damage.rs index f8a43e8b7ea..cd79f644a9a 100644 --- a/components/style/gecko/restyle_damage.rs +++ b/components/style/gecko/restyle_damage.rs @@ -72,7 +72,8 @@ impl GeckoRestyleDamage { } else { StyleChange::Unchanged }; - StyleDifference::new(GeckoRestyleDamage(nsChangeHint(hint)), change) + let damage = GeckoRestyleDamage(nsChangeHint(hint)); + StyleDifference { damage, change } } /// Returns true if this restyle damage contains all the damage of |other|. diff --git a/components/style/matching.rs b/components/style/matching.rs index 533f3446490..a38b93c3464 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -31,16 +31,6 @@ pub struct StyleDifference { pub change: StyleChange, } -impl StyleDifference { - /// Creates a new `StyleDifference`. - pub fn new(damage: RestyleDamage, change: StyleChange) -> Self { - StyleDifference { - change: change, - damage: damage, - } - } -} - /// Represents whether or not the style of an element has changed. #[derive(Clone, Copy, Debug)] pub enum StyleChange { diff --git a/components/style/servo/restyle_damage.rs b/components/style/servo/restyle_damage.rs index 2dc6d3a30ab..52e1d402ef2 100644 --- a/components/style/servo/restyle_damage.rs +++ b/components/style/servo/restyle_damage.rs @@ -74,7 +74,7 @@ impl ServoRestyleDamage { // optimization to skip the cascade in those cases applies. StyleChange::Changed { reset_only: false } }; - StyleDifference::new(damage, change) + StyleDifference { damage, change } } /// Returns a bitmask that represents a flow that needs to be rebuilt and