Bug 1371115 - Part 9: rename macro from impl_gecko_keyword_from_trait to impl_gecko_keyword_conversions. r?hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 04 Jul 2017 17:20:11 +0900
changeset 603550 3127de6d0fb952815a8ecc6504f2c72803dd3e5b
parent 603549 7394acea4ffe949bcd5c1ab786286c4329c0d002
child 603551 f5cc4d75e1d76530f9912bdfcdbfa5a64d6ab84f
push id66823
push userbmo:dakatsuka@mozilla.com
push dateTue, 04 Jul 2017 08:33:34 +0000
reviewershiro
bugs1371115
milestone56.0a1
Bug 1371115 - Part 9: rename macro from impl_gecko_keyword_from_trait to impl_gecko_keyword_conversions. r?hiro Name of other macros that implement From trait is XX_conversions. However, impl_gecko_keyword_from_trait macro name is not consistency. MozReview-Commit-ID: K719RyEMP8K
servo/components/style/properties/longhand/font.mako.rs
--- a/servo/components/style/properties/longhand/font.mako.rs
+++ b/servo/components/style/properties/longhand/font.mako.rs
@@ -11,17 +11,17 @@
     %if product == "gecko":
         ${caller.body()}
     %else:
         unreachable!()
     %endif
 </%def>
 
 #[cfg(feature = "gecko")]
-macro_rules! impl_gecko_keyword_from_trait {
+macro_rules! impl_gecko_keyword_conversions {
     ($name: ident, $utype: ty) => {
         impl From<$utype> for $name {
             fn from(bits: $utype) -> $name {
                 $name::from_gecko_keyword(bits)
             }
         }
 
         impl From<$name> for $utype {
@@ -1618,17 +1618,17 @@ macro_rules! exclusive_value {
         if !result.is_empty() {
             Ok(SpecifiedValue::Value(result))
         } else {
             Err(StyleParseError::UnspecifiedError.into())
         }
     }
 
     #[cfg(feature = "gecko")]
-    impl_gecko_keyword_from_trait!(VariantEastAsian, u16);
+    impl_gecko_keyword_conversions!(VariantEastAsian, u16);
 </%helpers:longhand>
 
 <%helpers:longhand name="font-variant-ligatures" products="gecko" animation_value_type="discrete"
                    spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures">
     use properties::longhands::system_font::SystemFont;
     use std::fmt;
     use style_traits::ToCss;
 
@@ -1777,17 +1777,17 @@ macro_rules! exclusive_value {
         if !result.is_empty() {
             Ok(SpecifiedValue::Value(result))
         } else {
             Err(StyleParseError::UnspecifiedError.into())
         }
     }
 
     #[cfg(feature = "gecko")]
-    impl_gecko_keyword_from_trait!(VariantLigatures, u16);
+    impl_gecko_keyword_conversions!(VariantLigatures, u16);
 </%helpers:longhand>
 
 <%helpers:longhand name="font-variant-numeric" products="gecko" animation_value_type="discrete"
                    spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric">
     use properties::longhands::system_font::SystemFont;
     use std::fmt;
     use style_traits::ToCss;
 
@@ -1925,17 +1925,17 @@ macro_rules! exclusive_value {
         if !result.is_empty() {
             Ok(SpecifiedValue::Value(result))
         } else {
             Err(StyleParseError::UnspecifiedError.into())
         }
     }
 
     #[cfg(feature = "gecko")]
-    impl_gecko_keyword_from_trait!(VariantNumeric, u8);
+    impl_gecko_keyword_conversions!(VariantNumeric, u8);
 </%helpers:longhand>
 
 ${helpers.single_keyword_system("font-variant-position",
                                 "normal sub super",
                                 products="gecko",
                                 gecko_ffi_name="mFont.variantPosition",
                                 gecko_constant_prefix="NS_FONT_VARIANT_POSITION",
                                 spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",