From ce46e6d034fe215413c4ffdb6be5412f2c88dc84 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 28 Feb 2017 13:45:12 +1100 Subject: [PATCH] Remove raw_longhand helper function --- components/style/properties/helpers.mako.rs | 28 ++++++++------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index ca5806fc2de..41f3eff772f 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -4,23 +4,6 @@ <%! from data import Keyword, to_rust_ident, to_camel_case, LOGICAL_SIDES, PHYSICAL_SIDES, LOGICAL_SIZES %> -<%def name="longhand(name, **kwargs)"> - <%call expr="raw_longhand(name, **kwargs)"> - ${caller.body()} - % if not data.longhands_by_name[name].derived_from: - pub fn parse_specified(context: &ParserContext, input: &mut Parser) - % if data.longhands_by_name[name].boxed: - -> Result>, ()> { - parse(context, input).map(|result| DeclaredValue::Value(Box::new(result))) - % else: - -> Result, ()> { - parse(context, input).map(DeclaredValue::Value) - % endif - } - % endif - - - <%def name="predefined_type(name, type, initial_value, parse_method='parse', needs_context=True, vector=False, **kwargs)"> <%def name="predefined_type_inner(name, type, initial_value, parse_method)"> @@ -212,7 +195,7 @@ -<%def name="raw_longhand(*args, **kwargs)"> +<%def name="longhand(*args, **kwargs)"> <% property = data.declare_longhand(*args, **kwargs) if property is None: @@ -322,6 +305,15 @@ % endif } % if not property.derived_from: + pub fn parse_specified(context: &ParserContext, input: &mut Parser) + % if property.boxed: + -> Result>, ()> { + parse(context, input).map(|result| DeclaredValue::Value(Box::new(result))) + % else: + -> Result, ()> { + parse(context, input).map(DeclaredValue::Value) + % endif + } pub fn parse_declared(context: &ParserContext, input: &mut Parser) % if property.boxed: -> Result>, ()> {