Minor refactoring (thanks Clippy)
This commit is contained in:
parent
9949933d41
commit
ab0ef991b9
1 changed files with 3 additions and 8 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue