style: Have OneOrMoreSeparated replace OneOrMoreCommaSeparated.

A future patch series has some values that should be separated by spaces. This
allows us to re-use the code for serialization, but the types do get a little
clunky. The separator is now indicated with an associated type.
This commit is contained in:
Jonathan Chan 2017-06-19 15:35:58 -07:00
parent e41b7d06b4
commit 26179b3660
6 changed files with 64 additions and 14 deletions

View file

@ -19,7 +19,7 @@ use std::ascii::AsciiExt;
use std::borrow::Cow;
use std::fmt;
use std::ops::Range;
use style_traits::{ToCss, OneOrMoreCommaSeparated, ParseError, StyleParseError};
use style_traits::{ToCss, OneOrMoreSeparated, CommaSeparator, ParseError, StyleParseError};
use values::CustomIdent;
/// Parse the prelude of an @counter-style rule
@ -552,7 +552,9 @@ pub struct AdditiveTuple {
pub symbol: Symbol,
}
impl OneOrMoreCommaSeparated for AdditiveTuple {}
impl OneOrMoreSeparated for AdditiveTuple {
type S = CommaSeparator;
}
impl Parse for AdditiveTuple {
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {