Update euclid.

There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
This commit is contained in:
Emilio Cobos Álvarez 2019-07-22 12:49:39 +02:00
parent 2ff7cb5a37
commit 3d57c22e9c
133 changed files with 686 additions and 596 deletions

View file

@ -12,8 +12,8 @@ use crate::values::specified::length::LengthPercentage as SpecifiedLengthPercent
use crate::values::{computed, CSSFloat};
use crate::Zero;
use app_units::Au;
use euclid::default::{Rect, Transform3D};
use euclid;
use euclid::default::{Rect, Transform3D};
use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};

View file

@ -163,7 +163,7 @@ impl Parse for Quotes {
.try(|input| input.expect_ident_matching("none"))
.is_ok()
{
return Ok(Quotes::QuoteList(QuoteList::default()))
return Ok(Quotes::QuoteList(QuoteList::default()));
}
let mut quotes = Vec::new();
@ -180,7 +180,9 @@ impl Parse for Quotes {
}
if !quotes.is_empty() {
Ok(Quotes::QuoteList(QuoteList(crate::ArcSlice::from_iter(quotes.into_iter()))))
Ok(Quotes::QuoteList(QuoteList(crate::ArcSlice::from_iter(
quotes.into_iter(),
))))
} else {
Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
}

View file

@ -142,8 +142,8 @@ fn parse_number_with_clamping_mode<'i, 't>(
value: value.min(f32::MAX).max(f32::MIN),
calc_clamping_mode: None,
});
}
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {}
},
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
ref t => return Err(location.new_unexpected_token_error(t.clone())),
}
@ -537,7 +537,7 @@ impl Parse for Integer {
Token::Number {
int_value: Some(v), ..
} => return Ok(Integer::new(v)),
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {}
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {},
ref t => return Err(location.new_unexpected_token_error(t.clone())),
}
@ -813,7 +813,7 @@ impl Attr {
None => {
return Err(location
.new_custom_error(StyleParseErrorKind::UnspecifiedError));
}
},
};
Some((prefix, ns))
} else {
@ -823,10 +823,10 @@ impl Attr {
namespace: prefix_and_ns,
attribute: Atom::from(second_token.as_ref()),
});
}
},
// In the case of attr(foobar ) we don't want to error out
// because of the trailing whitespace
Token::WhiteSpace(..) => {}
Token::WhiteSpace(..) => {},
ref t => return Err(input.new_unexpected_token_error(t.clone())),
}
}

View file

@ -266,11 +266,14 @@ impl<S> PositionComponent<S> {
/// Returns the count of this component.
fn component_count(&self) -> usize {
match *self {
PositionComponent::Length(..) |
PositionComponent::Center => 1,
PositionComponent::Length(..) | PositionComponent::Center => 1,
PositionComponent::Side(_, ref lp) => {
if lp.is_some() { 2 } else { 1 }
}
if lp.is_some() {
2
} else {
1
}
},
}
}
}