diff --git a/components/style/values/generics/calc.rs b/components/style/values/generics/calc.rs index fa3b2987a21..1ceefa0ef8d 100644 --- a/components/style/values/generics/calc.rs +++ b/components/style/values/generics/calc.rs @@ -545,7 +545,7 @@ impl CalcNode { result = result + child.resolve_internal(leaf_to_output_fn)?.powi(2); } result.sqrt() - } + }, }) } @@ -669,7 +669,9 @@ impl CalcNode { dividend.visit_depth_first_internal(f); divisor.visit_depth_first_internal(f); }, - Self::Sum(ref mut children) | Self::MinMax(ref mut children, _) | Self::Hypot(ref mut children) => { + Self::Sum(ref mut children) | + Self::MinMax(ref mut children, _) | + Self::Hypot(ref mut children) => { for child in &mut **children { child.visit_depth_first_internal(f); } @@ -1002,7 +1004,7 @@ impl CalcNode { }; replace_self_with!(&mut result); - } + }, Self::Leaf(ref mut l) => { l.simplify(); }, diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs index 1eb601a3dc4..a4a9319a679 100644 --- a/components/style/values/specified/calc.rs +++ b/components/style/values/specified/calc.rs @@ -672,10 +672,12 @@ impl CalcNode { }, MathFunction::Log => { let a = Self::parse_number_argument(context, input)?; - let b = input.try_parse(|input| { - input.expect_comma()?; - Self::parse_number_argument(context, input) - }).ok(); + let b = input + .try_parse(|input| { + input.expect_comma()?; + Self::parse_number_argument(context, input) + }) + .ok(); let number = match b { Some(b) => a.log(b), @@ -823,8 +825,7 @@ impl CalcNode { where F: FnOnce() -> Result, { - closure() - .map_err(|()| input.new_custom_error(StyleParseErrorKind::UnspecifiedError)) + closure().map_err(|()| input.new_custom_error(StyleParseErrorKind::UnspecifiedError)) } /// Tries to simplify this expression into a `` or `` @@ -854,18 +855,19 @@ impl CalcNode { } /// Tries to simplify this expression into a `