Fix for #8593 'loop..match' should be 'while let'

changed line 641 of constellation.rs to while let

added while let at line 1201 in constellation.rs

added while let to line 1199 in block.rs
This commit is contained in:
r0e 2015-11-18 20:37:47 -08:00
parent a5babb89a0
commit 99acd46c48
3 changed files with 29 additions and 47 deletions

View file

@ -524,18 +524,17 @@ pub mod specified {
let mut products = Vec::new();
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
loop {
match input.next() {
Ok(Token::Delim('+')) => {
while let Ok(token) = input.next() {
match token {
Token::Delim('+') => {
products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));
}
Ok(Token::Delim('-')) => {
Token::Delim('-') => {
let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit));
right.values.push(CalcValueNode::Number(-1.));
products.push(right);
}
Ok(_) => return Err(()),
_ => break
_ => return Err(())
}
}