diff --git a/ast.rs b/ast.rs index 45d4678d..632f526e 100644 --- a/ast.rs +++ b/ast.rs @@ -138,6 +138,7 @@ impl<'self> SkipWhitespaceIterable<'self> for &'self [ComponentValue] { } } +#[deriving(Clone)] pub struct SkipWhitespaceIterator<'self> { iter_with_whitespace: vec::VecIterator<'self, ComponentValue>, } diff --git a/color.rs b/color.rs index b758aac0..6c6f5e30 100644 --- a/color.rs +++ b/color.rs @@ -22,12 +22,14 @@ pub enum Color { // Return None on invalid/unsupported value (not a color) -pub fn parse_color(component_value: &ComponentValue) -> Option { - match *component_value { - Hash(ref value) | IDHash(ref value) => parse_color_hash(*value), - Ident(ref value) => parse_color_keyword(*value), - Function(ref name, ref arguments) => parse_color_function(*name, *arguments), - _ => None +impl Color { + pub fn parse(component_value: &ComponentValue) -> Option { + match *component_value { + Hash(ref value) | IDHash(ref value) => parse_color_hash(*value), + Ident(ref value) => parse_color_keyword(*value), + Function(ref name, ref arguments) => parse_color_function(*name, *arguments), + _ => None + } } }