From c8ea840106c4ac592a8c45aeda121d505d81b074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 4 Jan 2017 18:22:24 +0100 Subject: [PATCH] style: Simplify Debug impl for PropertyDeclaration reusing to_css. These two functions appear in the data from bug 1328497. I think the way to fix this is another one (either using static arrays to get the interesting data, or making rust generate the equivalent code). --- components/style/properties/properties.mako.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 75ea5dff3d5..e53040e7982 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -842,17 +842,7 @@ impl fmt::Debug for PropertyDeclaration { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(self.id().to_css(f)); try!(f.write_str(": ")); - match *self { - % for property in data.longhands: - % if not property.derived_from: - PropertyDeclaration::${property.camel_case}(ref value) => value.to_css(f), - % endif - % endfor - PropertyDeclaration::Custom(_, ref value) => value.to_css(f), - % if any(property.derived_from for property in data.longhands): - _ => Err(fmt::Error), - % endif - } + self.to_css(f) } }