From 7995a9ed51f95d5cdc9b75c8c30cb019f972014f Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 11 Jul 2017 14:59:17 +0200 Subject: [PATCH] Derive ToCss for font-weight descriptors --- components/style/font_face.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/components/style/font_face.rs b/components/style/font_face.rs index 04554ca81ae..b180e1e7fe2 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -75,7 +75,7 @@ add_impls_for_keyword_enum!(FontDisplay); /// A font-weight value for a @font-face rule. /// The font-weight CSS property specifies the weight or boldness of the font. #[cfg(feature = "gecko")] -#[derive(Clone, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, Eq, PartialEq, ToCss)] pub enum FontWeight { /// Numeric font weights for fonts that provide more than just normal and bold. Weight(font_weight::T), @@ -85,17 +85,6 @@ pub enum FontWeight { Bold, } -#[cfg(feature = "gecko")] -impl ToCss for FontWeight { - fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { - match *self { - FontWeight::Normal => dest.write_str("normal"), - FontWeight::Bold => dest.write_str("bold"), - FontWeight::Weight(ref weight) => weight.to_css(dest), - } - } -} - #[cfg(feature = "gecko")] impl Parse for FontWeight { fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>)