aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-03-08 16:54:10 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-03-08 16:54:10 +0100
commitdae17dcaf3be874f14f459333cdb738abe019bf4 (patch)
tree51bb09eca80783ddc6e59c3a07bf270ce7eb0b9b
parentc11d398010f1c26622c64e076786a00776096b94 (diff)
downloadservo-dae17dcaf3be874f14f459333cdb738abe019bf4.tar.gz
servo-dae17dcaf3be874f14f459333cdb738abe019bf4.zip
style: Fix indentation in calc parsing code.
-rw-r--r--components/style/values/specified/length.rs42
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 })
}