Minor refactoring (thanks Clippy)

This commit is contained in:
Chris Wong 2016-03-06 18:25:21 +13:00
parent 9949933d41
commit ab0ef991b9

View file

@ -477,14 +477,9 @@ impl<'cx, 'i> Parser<'cx, 'i> {
/// Parses and renders the attributes of an element.
fn class_shorthand(&mut self) -> PResult<()> {
let mut classes = Vec::new();
loop {
match self.input {
[dot!(), ident!(_, _), ..] => {
self.shift(1);
classes.push(try!(self.name()));
},
_ => break,
}
while let [dot!(), ident!(_, _), ..] = self.input {
self.shift(1);
classes.push(try!(self.name()));
}
if !classes.is_empty() {
self.render.attribute_start("class");