diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index b61e5554864..ec42f822442 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -440,7 +440,7 @@ impl AnimationValue { % if prop.is_animatable_with_computed_value: from % else: - &from.into() + &from.clone().into() % endif )) % if prop.boxed: @@ -472,7 +472,7 @@ impl AnimationValue { % if prop.is_animatable_with_computed_value: val.to_computed_value(context) % else: - From::from(&val.to_computed_value(context)) + From::from(val.to_computed_value(context)) % endif )) }, @@ -503,7 +503,7 @@ impl AnimationValue { }, }; % if not prop.is_animatable_with_computed_value: - let computed = From::from(&computed); + let computed = From::from(computed); % endif Some(AnimationValue::${prop.camel_case}(computed)) }, @@ -570,8 +570,8 @@ impl AnimationValue { % if prop.is_animatable_with_computed_value: computed_values.get_${prop.style_struct.ident.strip("_")}().clone_${prop.ident}()) % else: - From::from(&computed_values.get_${prop.style_struct.ident.strip("_")}() - .clone_${prop.ident}())) + From::from(computed_values.get_${prop.style_struct.ident.strip("_")}() + .clone_${prop.ident}())) % endif } % endif @@ -2626,8 +2626,8 @@ impl Animatable for Either } } -impl <'a> From<<&'a IntermediateRGBA> for RGBA { - fn from(extended_rgba: &IntermediateRGBA) -> RGBA { +impl From for RGBA { + fn from(extended_rgba: IntermediateRGBA) -> RGBA { // RGBA::from_floats clamps each component values. RGBA::from_floats(extended_rgba.red, extended_rgba.green, @@ -2636,8 +2636,8 @@ impl <'a> From<<&'a IntermediateRGBA> for RGBA { } } -impl <'a> From<<&'a RGBA> for IntermediateRGBA { - fn from(rgba: &RGBA) -> IntermediateRGBA { +impl From for IntermediateRGBA { + fn from(rgba: RGBA) -> IntermediateRGBA { IntermediateRGBA::new(rgba.red_f32(), rgba.green_f32(), rgba.blue_f32(), @@ -2725,12 +2725,12 @@ impl Animatable for IntermediateRGBA { } } -impl<'a> From<<&'a Either> for Either { - fn from(from: &Either) -> Either { - match *from { - Either::First(ref from) => - match *from { - CSSParserColor::RGBA(ref color) => +impl From> for Either { + fn from(from: Either) -> Either { + match from { + Either::First(from) => + match from { + CSSParserColor::RGBA(color) => Either::First(IntermediateColor::IntermediateRGBA( IntermediateRGBA::new(color.red_f32(), color.green_f32(), @@ -2744,12 +2744,12 @@ impl<'a> From<<&'a Either> for Either From<<&'a Either> for Either { - fn from(from: &Either) -> Either { - match *from { - Either::First(ref from) => - match *from { - IntermediateColor::IntermediateRGBA(ref color) => +impl From> for Either { + fn from(from: Either) -> Either { + match from { + Either::First(from) => + match from { + IntermediateColor::IntermediateRGBA(color) => Either::First(CSSParserColor::RGBA(RGBA::from_floats(color.red, color.green, color.blue, @@ -2800,10 +2800,10 @@ impl Animatable for IntermediateColor { } } -impl <'a> From<<&'a CSSParserColor> for IntermediateColor { - fn from(color: &CSSParserColor) -> IntermediateColor { - match *color { - CSSParserColor::RGBA(ref color) => +impl From for IntermediateColor { + fn from(color: CSSParserColor) -> IntermediateColor { + match color { + CSSParserColor::RGBA(color) => IntermediateColor::IntermediateRGBA(IntermediateRGBA::new(color.red_f32(), color.green_f32(), color.blue_f32(), @@ -2813,10 +2813,10 @@ impl <'a> From<<&'a CSSParserColor> for IntermediateColor { } } -impl <'a> From<<&'a IntermediateColor> for CSSParserColor { - fn from(color: &IntermediateColor) -> CSSParserColor { - match *color { - IntermediateColor::IntermediateRGBA(ref color) => +impl From for CSSParserColor { + fn from(color: IntermediateColor) -> CSSParserColor { + match color { + IntermediateColor::IntermediateRGBA(color) => CSSParserColor::RGBA(RGBA::from_floats(color.red, color.green, color.blue, @@ -2850,25 +2850,25 @@ impl <'a> From<<&'a IntermediateColor> for CSSParserColor { /// Intermediate type for box-shadow list and text-shadow list. pub struct Intermediate${type}ShadowList(pub SmallVec<[Intermediate${type}Shadow; 1]>); - impl <'a> From<<&'a Intermediate${type}ShadowList> for ${type}ShadowList { - fn from(shadow_list: &Intermediate${type}ShadowList) -> ${type}ShadowList { - ${type}ShadowList(shadow_list.0.iter().map(|s| s.into()).collect()) + impl From for ${type}ShadowList { + fn from(shadow_list: Intermediate${type}ShadowList) -> ${type}ShadowList { + ${type}ShadowList(shadow_list.0.into_iter().map(|s| s.into()).collect()) } } - impl <'a> From<<&'a ${type}ShadowList> for Intermediate${type}ShadowList { - fn from(shadow_list: &${type}ShadowList) -> Intermediate${type}ShadowList { - Intermediate${type}ShadowList(shadow_list.0.iter().map(|s| s.into()).collect()) + impl From<${type}ShadowList> for Intermediate${type}ShadowList { + fn from(shadow_list: ${type}ShadowList) -> Intermediate${type}ShadowList { + Intermediate${type}ShadowList(shadow_list.0.into_iter().map(|s| s.into()).collect()) } } - impl <'a> From<<&'a Intermediate${type}Shadow> for ${type}Shadow { - fn from(shadow: &Intermediate${type}Shadow) -> ${type}Shadow { + impl From for ${type}Shadow { + fn from(shadow: Intermediate${type}Shadow) -> ${type}Shadow { ${type}Shadow { offset_x: shadow.offset_x, offset_y: shadow.offset_y, blur_radius: shadow.blur_radius, - color: (&shadow.color).into(), + color: shadow.color.into(), % if type == "Box": spread_radius: shadow.spread_radius, inset: shadow.inset, @@ -2877,13 +2877,13 @@ impl <'a> From<<&'a IntermediateColor> for CSSParserColor { } } - impl <'a> From<<&'a ${type}Shadow> for Intermediate${type}Shadow { - fn from(shadow: &${type}Shadow) -> Intermediate${type}Shadow { + impl From<${type}Shadow> for Intermediate${type}Shadow { + fn from(shadow: ${type}Shadow) -> Intermediate${type}Shadow { Intermediate${type}Shadow { offset_x: shadow.offset_x, offset_y: shadow.offset_y, blur_radius: shadow.blur_radius, - color: (&shadow.color).into(), + color: shadow.color.into(), % if type == "Box": spread_radius: shadow.spread_radius, inset: shadow.inset,