Skip to content

Commit

Permalink
Rename CommaSeparated to OneOrMoreCommaSeparated, reflecting its beha…
Browse files Browse the repository at this point in the history
…vior.
  • Loading branch information
SimonSapin committed Feb 3, 2017
1 parent 4701850 commit 9ec8418
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions components/style/font_face.rs
Expand Up @@ -15,7 +15,7 @@ use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use parser::{ParserContext, log_css_error, Parse};
use std::fmt;
use std::iter;
use style_traits::{ToCss, CommaSeparated};
use style_traits::{ToCss, OneOrMoreCommaSeparated};
use values::specified::url::SpecifiedUrl;

/// A source for a font-face rule.
Expand Down Expand Up @@ -46,7 +46,7 @@ impl ToCss for Source {
}
}

impl CommaSeparated for Source {}
impl OneOrMoreCommaSeparated for Source {}

/// A `UrlSource` represents a font-face source that has been specified with a
/// `url()` function.
Expand Down Expand Up @@ -323,7 +323,7 @@ pub mod unicode_range {
use cssparser::{Parser, Token};
use parser::{ParserContext, Parse};
use std::fmt;
use style_traits::{ToCss, CommaSeparated};
use style_traits::{ToCss, OneOrMoreCommaSeparated};

/// Maximum value of the end of a range
pub const MAX: u32 = ::std::char::MAX as u32;
Expand All @@ -338,7 +338,7 @@ pub mod unicode_range {
pub end: u32,
}

impl CommaSeparated for Range {}
impl OneOrMoreCommaSeparated for Range {}

impl Parse for Range {
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
Expand Down
4 changes: 2 additions & 2 deletions components/style/parser.rs
Expand Up @@ -11,7 +11,7 @@ use error_reporting::ParseErrorReporter;
#[cfg(feature = "gecko")]
use gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI};
use servo_url::ServoUrl;
use style_traits::CommaSeparated;
use style_traits::OneOrMoreCommaSeparated;
use stylesheets::{MemoryHoleReporter, Origin};

/// Extra data that the style backend may need to parse stylesheets.
Expand Down Expand Up @@ -104,7 +104,7 @@ pub trait Parse : Sized {
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()>;
}

impl<T> Parse for Vec<T> where T: Parse + CommaSeparated {
impl<T> Parse for Vec<T> where T: Parse + OneOrMoreCommaSeparated {
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
input.parse_comma_separated(|input| T::parse(context, input))
}
Expand Down
2 changes: 1 addition & 1 deletion components/style_traits/lib.rs
Expand Up @@ -59,4 +59,4 @@ pub mod cursor;
pub mod values;
pub mod viewport;

pub use values::{ToCss, CommaSeparated};
pub use values::{ToCss, OneOrMoreCommaSeparated};
4 changes: 2 additions & 2 deletions components/style_traits/values.rs
Expand Up @@ -25,9 +25,9 @@ pub trait ToCss {
}

/// Marker trait to automatically implement ToCss for Vec<T>.
pub trait CommaSeparated {}
pub trait OneOrMoreCommaSeparated {}

impl<T> ToCss for Vec<T> where T: ToCss + CommaSeparated {
impl<T> ToCss for Vec<T> where T: ToCss + OneOrMoreCommaSeparated {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
let mut iter = self.iter();
iter.next().unwrap().to_css(dest)?;
Expand Down

0 comments on commit 9ec8418

Please sign in to comment.