diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-03-08 16:54:10 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-03-08 16:54:10 +0100 |
commit | dae17dcaf3be874f14f459333cdb738abe019bf4 (patch) | |
tree | 51bb09eca80783ddc6e59c3a07bf270ce7eb0b9b | |
parent | c11d398010f1c26622c64e076786a00776096b94 (diff) | |
download | servo-dae17dcaf3be874f14f459333cdb738abe019bf4.tar.gz servo-dae17dcaf3be874f14f459333cdb738abe019bf4.zip |
style: Fix indentation in calc parsing code.
-rw-r--r-- | components/style/values/specified/length.rs | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 2b75773a6ad..42d4a9c1188 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -585,33 +585,29 @@ impl CalcLengthOrPercentage { products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit))); loop { - let position = input.position(); - match input.next_including_whitespace() { - Ok(Token::WhiteSpace(_)) => { - match input.next() { - Ok(Token::Delim('+')) => { - products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit))); - } - - Ok(Token::Delim('-')) => { - let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit)); - right.values.push(CalcValueNode::Number(-1.)); - products.push(right); + let position = input.position(); + match input.next_including_whitespace() { + Ok(Token::WhiteSpace(_)) => { + match input.next() { + Ok(Token::Delim('+')) => { + products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit))); + } + Ok(Token::Delim('-')) => { + let mut right = try!(CalcLengthOrPercentage::parse_product(input, expected_unit)); + right.values.push(CalcValueNode::Number(-1.)); + products.push(right); + } + _ => { + return Err(()); + } + } } - _ => { - return Err(()); + input.reset(position); + break } - } - } - _ => { - input.reset(position); - break } - } - } - - + } Ok(CalcSumNode { products: products }) } |