aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/values/mod.rs')
-rw-r--r--components/style/values/mod.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs
index bbb6603bb90..506584c1e76 100644
--- a/components/style/values/mod.rs
+++ b/components/style/values/mod.rs
@@ -34,9 +34,9 @@ define_keyword_type!(None_, "none");
define_keyword_type!(Auto, "auto");
define_keyword_type!(Normal, "normal");
-#[derive(Clone, Copy, HasViewportPercentage, PartialEq)]
-#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
/// A struct representing one of two kinds of values.
+#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+#[derive(Clone, Copy, HasViewportPercentage, PartialEq, ToCss)]
pub enum Either<A, B> {
/// The first value.
First(A),
@@ -53,15 +53,6 @@ impl<A: Debug, B: Debug> Debug for Either<A, B> {
}
}
-impl<A: ToCss, B: ToCss> ToCss for Either<A, B> {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- match *self {
- Either::First(ref v) => v.to_css(dest),
- Either::Second(ref v) => v.to_css(dest),
- }
- }
-}
-
impl<A: Parse, B: Parse> Parse for Either<A, B> {
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Either<A, B>, ()> {
if let Ok(v) = input.try(|i| A::parse(context, i)) {