style: Rustfmt recent changes.

This commit is contained in:
Emilio Cobos Álvarez 2019-02-23 20:40:02 -08:00
parent 71daec59eb
commit be616c31e8
15 changed files with 41 additions and 37 deletions

View file

@ -4,7 +4,7 @@
//! Generic types for CSS values related to backgrounds.
use crate::values::generics::length::{LengthPercentageOrAuto, GenericLengthPercentageOrAuto};
use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};

View file

@ -127,8 +127,8 @@ impl Parse for CounterStyleOrNone {
let symbols = Symbols::parse(context, input)?;
// There must be at least two symbols for alphabetic or
// numeric system.
if (symbols_type == SymbolsType::Alphabetic ||
symbols_type == SymbolsType::Numeric) && symbols.0.len() < 2
if (symbols_type == SymbolsType::Alphabetic || symbols_type == SymbolsType::Numeric) &&
symbols.0.len() < 2
{
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
@ -177,7 +177,7 @@ impl SpecifiedValueInfo for CounterStyleOrNone {
#[repr(transparent)]
pub struct NonNegative<T>(pub T);
impl <T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
impl<T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
type Output = Self;
fn add(self, other: Self) -> Self {
@ -185,7 +185,7 @@ impl <T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
}
}
impl <T: Zero> Zero for NonNegative<T> {
impl<T: Zero> Zero for NonNegative<T> {
fn is_zero(&self) -> bool {
self.0.is_zero()
}

View file

@ -32,7 +32,10 @@ pub use self::GenericPosition as Position;
impl<H, V> Position<H, V> {
/// Returns a new position.
pub fn new(horizontal: H, vertical: V) -> Self {
Self { horizontal, vertical }
Self {
horizontal,
vertical,
}
}
}

View file

@ -98,7 +98,11 @@ pub use self::GenericTransformOrigin as TransformOrigin;
impl<H, V, D> TransformOrigin<H, V, D> {
/// Returns a new transform origin.
pub fn new(horizontal: H, vertical: V, depth: D) -> Self {
Self { horizontal, vertical, depth }
Self {
horizontal,
vertical,
depth,
}
}
}