Skip to content

Commit 850eac1

Browse files
committed
Remove unnecesseray clone
1 parent a944f54 commit 850eac1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/color.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ impl Color {
141141
///
142142
/// FIXME(#2) Deprecated CSS2 System Colors are not supported yet.
143143
pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Color, BasicParseError<'i>> {
144+
// FIXME: remove clone() when lifetimes are non-lexical
144145
let token = input.next()?.clone();
145146
match token {
146147
Token::Hash(ref value) | Token::IDHash(ref value) => {
@@ -154,7 +155,7 @@ impl Color {
154155
}).map_err(ParseError::<()>::basic);
155156
}
156157
_ => Err(())
157-
}.map_err(|()| BasicParseError::UnexpectedToken(token.clone()))
158+
}.map_err(|()| BasicParseError::UnexpectedToken(token))
158159
}
159160

160161
/// Parse a color hash, without the leading '#' character.

0 commit comments

Comments
 (0)