diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs index 631295dc435..ed503eda930 100644 --- a/components/style/values/mod.rs +++ b/components/style/values/mod.rs @@ -52,7 +52,7 @@ impl Parse for Impossible { /// A struct representing one of two kinds of values. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Clone, Copy, HasViewportPercentage, PartialEq, ToCss)] +#[derive(Clone, Copy, HasViewportPercentage, PartialEq, ToComputedValue, ToCss)] pub enum Either { /// The first value. First(A), @@ -80,27 +80,6 @@ impl Parse for Either { } } -use self::computed::{Context, ToComputedValue}; - -impl ToComputedValue for Either { - type ComputedValue = Either; - - fn to_computed_value(&self, context: &Context) -> Self::ComputedValue { - match *self { - Either::First(ref a) => Either::First(a.to_computed_value(context)), - Either::Second(ref a) => Either::Second(a.to_computed_value(context)), - } - } - - #[inline] - fn from_computed_value(computed: &Self::ComputedValue) -> Self { - match *computed { - Either::First(ref a) => Either::First(ToComputedValue::from_computed_value(a)), - Either::Second(ref a) => Either::Second(ToComputedValue::from_computed_value(a)), - } - } -} - /// https://drafts.csswg.org/css-values-4/#custom-idents #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]