Run rustfmt on selectors, servo_arc, and style.

This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
This commit is contained in:
Bobby Holley 2018-04-10 17:35:15 -07:00
parent f7ae1a37e3
commit c99bcdd4b8
181 changed files with 9981 additions and 7933 deletions

View file

@ -32,7 +32,9 @@ impl RepeatableListAnimatable for BackgroundSize {}
impl ToAnimatedZero for BackgroundSize {
#[inline]
fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) }
fn to_animated_zero(&self) -> Result<Self, ()> {
Err(())
}
}
impl ToAnimatedValue for BackgroundSize {
@ -54,17 +56,15 @@ impl ToAnimatedValue for BackgroundSize {
LengthOrPercentageOrAuto::Percentage(percent) => {
LengthOrPercentageOrAuto::Percentage(Percentage(percent.0.max(0.)))
},
_ => value
_ => value,
}
};
match animated {
GenericBackgroundSize::Explicit { width, height } => {
GenericBackgroundSize::Explicit {
width: clamp_animated_value(width),
height: clamp_animated_value(height)
}
GenericBackgroundSize::Explicit { width, height } => GenericBackgroundSize::Explicit {
width: clamp_animated_value(width),
height: clamp_animated_value(height),
},
_ => animated
_ => animated,
}
}
}
@ -92,7 +92,10 @@ pub struct BackgroundRepeat(pub BackgroundRepeatKeyword, pub BackgroundRepeatKey
impl BackgroundRepeat {
/// Returns the `repeat repeat` value.
pub fn repeat() -> Self {
BackgroundRepeat(BackgroundRepeatKeyword::Repeat, BackgroundRepeatKeyword::Repeat)
BackgroundRepeat(
BackgroundRepeatKeyword::Repeat,
BackgroundRepeatKeyword::Repeat,
)
}
}
@ -126,15 +129,17 @@ impl ToComputedValue for SpecifiedBackgroundRepeat {
#[inline]
fn to_computed_value(&self, _: &Context) -> Self::ComputedValue {
match *self {
SpecifiedBackgroundRepeat::RepeatX => {
BackgroundRepeat(BackgroundRepeatKeyword::Repeat, BackgroundRepeatKeyword::NoRepeat)
}
SpecifiedBackgroundRepeat::RepeatY => {
BackgroundRepeat(BackgroundRepeatKeyword::NoRepeat, BackgroundRepeatKeyword::Repeat)
}
SpecifiedBackgroundRepeat::RepeatX => BackgroundRepeat(
BackgroundRepeatKeyword::Repeat,
BackgroundRepeatKeyword::NoRepeat,
),
SpecifiedBackgroundRepeat::RepeatY => BackgroundRepeat(
BackgroundRepeatKeyword::NoRepeat,
BackgroundRepeatKeyword::Repeat,
),
SpecifiedBackgroundRepeat::Keywords(horizontal, vertical) => {
BackgroundRepeat(horizontal, vertical.unwrap_or(horizontal))
}
},
}
}
@ -145,13 +150,13 @@ impl ToComputedValue for SpecifiedBackgroundRepeat {
match (computed.0, computed.1) {
(BackgroundRepeatKeyword::Repeat, BackgroundRepeatKeyword::NoRepeat) => {
SpecifiedBackgroundRepeat::RepeatX
}
},
(BackgroundRepeatKeyword::NoRepeat, BackgroundRepeatKeyword::Repeat) => {
SpecifiedBackgroundRepeat::RepeatY
}
},
(horizontal, vertical) => {
SpecifiedBackgroundRepeat::Keywords(horizontal, Some(vertical))
}
},
}
}
}