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>
Wed, 28 Jun 2017 10:23:39 +0900
changeset 601117 3e1cdb25aec68a598047982ee1c056764ad8ffba
parent 601116 4cab85c2390db01a27ce5a14b9ec1fa05638a776
child 601118 6f5b481e47035cd9865669c39d38f23337e82004
push id65962
push userbmo:dakatsuka@mozilla.com
push dateWed, 28 Jun 2017 01:27:06 +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 {
@@ -1549,17 +1549,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;
 
@@ -1708,17 +1708,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;
 
@@ -1856,17 +1856,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",