mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
style: Run rustfmt on servo/components/style and servo/ports/geckolib
This patch is generated by running `cargo +nightly fmt` under `servo/components/style/` and `servo/ports/geckolib` against mozilla-central https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512 My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17) Manually remove the redundant braces in author_styles.rs to fix a warning. Differential Revision: https://phabricator.services.mozilla.com/D131556
This commit is contained in:
parent
33ad82c3da
commit
a0617bff0d
50 changed files with 486 additions and 340 deletions
|
@ -380,43 +380,47 @@ impl CalcNode {
|
|||
|
||||
Ok(Self::MinMax(arguments.into(), op))
|
||||
},
|
||||
MathFunction::Sin |
|
||||
MathFunction::Cos |
|
||||
MathFunction::Tan => {
|
||||
MathFunction::Sin | MathFunction::Cos | MathFunction::Tan => {
|
||||
let argument = Self::parse_argument(context, input, CalcUnit::Angle)?;
|
||||
let radians = match argument.to_number() {
|
||||
Ok(v) => v,
|
||||
Err(()) => match argument.to_angle() {
|
||||
Ok(angle) => angle.radians(),
|
||||
Err(()) => return Err(
|
||||
input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
|
||||
),
|
||||
Err(()) => {
|
||||
return Err(
|
||||
input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
|
||||
)
|
||||
},
|
||||
},
|
||||
};
|
||||
let number = match function {
|
||||
MathFunction::Sin => radians.sin(),
|
||||
MathFunction::Cos => radians.cos(),
|
||||
MathFunction::Tan => radians.tan(),
|
||||
_ => unsafe { debug_unreachable!("We just checked!"); },
|
||||
_ => unsafe {
|
||||
debug_unreachable!("We just checked!");
|
||||
},
|
||||
};
|
||||
Ok(Self::Leaf(Leaf::Number(number)))
|
||||
},
|
||||
MathFunction::Asin |
|
||||
MathFunction::Acos |
|
||||
MathFunction::Atan => {
|
||||
MathFunction::Asin | MathFunction::Acos | MathFunction::Atan => {
|
||||
let argument = Self::parse_argument(context, input, CalcUnit::Number)?;
|
||||
let number = match argument.to_number() {
|
||||
Ok(v) => v,
|
||||
Err(()) => return Err(
|
||||
input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
|
||||
),
|
||||
Err(()) => {
|
||||
return Err(
|
||||
input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
|
||||
)
|
||||
},
|
||||
};
|
||||
|
||||
let radians = match function {
|
||||
MathFunction::Asin => number.asin(),
|
||||
MathFunction::Acos => number.acos(),
|
||||
MathFunction::Atan => number.atan(),
|
||||
_ => unsafe { debug_unreachable!("We just checked!"); },
|
||||
_ => unsafe {
|
||||
debug_unreachable!("We just checked!");
|
||||
},
|
||||
};
|
||||
|
||||
Ok(Self::Leaf(Leaf::Angle(Angle::from_radians(radians))))
|
||||
|
@ -597,7 +601,9 @@ impl CalcNode {
|
|||
|
||||
let function = match MathFunction::from_ident(&*name) {
|
||||
Ok(f) => f,
|
||||
Err(()) => return Err(location.new_unexpected_token_error(Token::Function(name.clone()))),
|
||||
Err(()) => {
|
||||
return Err(location.new_unexpected_token_error(Token::Function(name.clone())))
|
||||
},
|
||||
};
|
||||
|
||||
if matches!(function, Sin | Cos | Tan | Asin | Acos | Atan) && !trig_enabled() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue