mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Rustfmt recent changes.
This commit is contained in:
parent
c7f30ad0df
commit
2a6cdaa30a
22 changed files with 141 additions and 172 deletions
|
@ -70,7 +70,7 @@ impl nsCSSValue {
|
|||
/// Sets LengthPercentage value to this nsCSSValue.
|
||||
pub unsafe fn set_length_percentage(&mut self, lp: LengthPercentage) {
|
||||
if lp.was_calc {
|
||||
return bindings::Gecko_CSSValue_SetCalc(self, lp.into())
|
||||
return bindings::Gecko_CSSValue_SetCalc(self, lp.into());
|
||||
}
|
||||
debug_assert!(lp.percentage.is_none() || lp.unclamped_length() == Length::zero());
|
||||
if let Some(p) = lp.percentage {
|
||||
|
@ -93,17 +93,12 @@ impl nsCSSValue {
|
|||
pub unsafe fn get_length_percentage(&self) -> LengthPercentage {
|
||||
match self.mUnit {
|
||||
nsCSSUnit::eCSSUnit_Pixel => {
|
||||
LengthPercentage::new(
|
||||
Length::new(bindings::Gecko_CSSValue_GetNumber(self)),
|
||||
None,
|
||||
)
|
||||
LengthPercentage::new(Length::new(bindings::Gecko_CSSValue_GetNumber(self)), None)
|
||||
},
|
||||
nsCSSUnit::eCSSUnit_Percent => LengthPercentage::new_percent(Percentage(
|
||||
bindings::Gecko_CSSValue_GetPercentage(self),
|
||||
)),
|
||||
nsCSSUnit::eCSSUnit_Calc => {
|
||||
bindings::Gecko_CSSValue_GetCalc(self).into()
|
||||
},
|
||||
nsCSSUnit::eCSSUnit_Calc => bindings::Gecko_CSSValue_GetCalc(self).into(),
|
||||
_ => panic!("Unexpected unit"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue