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.
|
/// Parses and renders the attributes of an element.
|
||||||
fn class_shorthand(&mut self) -> PResult<()> {
|
fn class_shorthand(&mut self) -> PResult<()> {
|
||||||
let mut classes = Vec::new();
|
let mut classes = Vec::new();
|
||||||
loop {
|
while let [dot!(), ident!(_, _), ..] = self.input {
|
||||||
match self.input {
|
self.shift(1);
|
||||||
[dot!(), ident!(_, _), ..] => {
|
classes.push(try!(self.name()));
|
||||||
self.shift(1);
|
|
||||||
classes.push(try!(self.name()));
|
|
||||||
},
|
|
||||||
_ => break,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if !classes.is_empty() {
|
if !classes.is_empty() {
|
||||||
self.render.attribute_start("class");
|
self.render.attribute_start("class");
|
||||||
|
|
Loading…
Add table
Reference in a new issue