From fb8b6fc0a5f4b1ab8e20314a512a20729bc98587 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 4 Mar 2018 23:13:31 +0100 Subject: [PATCH] Derive ToCss for CounterBound --- components/style/counter_style/mod.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/components/style/counter_style/mod.rs b/components/style/counter_style/mod.rs index fa614d476de..397598d45a7 100644 --- a/components/style/counter_style/mod.rs +++ b/components/style/counter_style/mod.rs @@ -447,7 +447,7 @@ impl Parse for Negative { pub struct Ranges(pub Vec>); /// A bound found in `Ranges`. -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, ToCss)] pub enum CounterBound { /// An integer bound. /// @@ -514,20 +514,9 @@ fn range_to_css(range: &Range, dest: &mut CssWriter) -> fmt: where W: Write, { - bound_to_css(range.start, dest)?; + range.start.to_css(dest)?; dest.write_char(' ')?; - bound_to_css(range.end, dest) -} - -fn bound_to_css(range: CounterBound, dest: &mut CssWriter) -> fmt::Result -where - W: Write, -{ - if let CounterBound::Integer(finite) = range { - finite.to_css(dest) - } else { - dest.write_str("infinite") - } + range.end.to_css(dest) } ///