From d2dab247481ea85e7862ecd18d47e8d1c366a23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 1 Oct 2017 13:17:53 +0200 Subject: [PATCH] style: Remove boilerplate code in the properties module. --- .../style/properties/properties.mako.rs | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index eda93910730..f61ebdef79a 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2145,16 +2145,16 @@ impl ComputedValues { % endfor ) -> Arc { Arc::new(Self { - inner: ComputedValuesInner::new( + inner: ComputedValuesInner { custom_properties, writing_mode, - flags, rules, visited_style, - % for style_struct in data.active_style_structs(): + flags, + % for style_struct in data.active_style_structs(): ${style_struct.ident}, - % endfor - ) + % endfor + } }) } @@ -2162,32 +2162,6 @@ impl ComputedValues { pub fn initial_values() -> &'static Self { &*INITIAL_SERVO_VALUES } } -#[cfg(feature = "servo")] -impl ComputedValuesInner { - /// Construct a `ComputedValuesInner` instance. - pub fn new( - custom_properties: Option>, - writing_mode: WritingMode, - flags: ComputedValueFlags, - rules: Option, - visited_style: Option>, - % for style_struct in data.active_style_structs(): - ${style_struct.ident}: Arc, - % endfor - ) -> Self { - ComputedValuesInner { - custom_properties: custom_properties, - writing_mode: writing_mode, - rules: rules, - visited_style: visited_style, - flags: flags, - % for style_struct in data.active_style_structs(): - ${style_struct.ident}: ${style_struct.ident}, - % endfor - } - } -} - #[cfg(feature = "servo")] impl ops::Deref for ComputedValues { type Target = ComputedValuesInner;