Format remaining files

This commit is contained in:
Pyfisch 2018-11-06 13:01:35 +01:00
parent bf47f90da6
commit cb07debcb6
252 changed files with 5944 additions and 3744 deletions

View file

@ -12,11 +12,17 @@ fn cascade(
name_and_value: &[(&str, &str)],
inherited: Option<&Arc<CustomPropertiesMap>>,
) -> Option<Arc<CustomPropertiesMap>> {
let values = name_and_value.iter().map(|&(name, value)| {
let mut input = ParserInput::new(value);
let mut parser = Parser::new(&mut input);
(Name::from(name), SpecifiedValue::parse(&mut parser).unwrap())
}).collect::<Vec<_>>();
let values = name_and_value
.iter()
.map(|&(name, value)| {
let mut input = ParserInput::new(value);
let mut parser = Parser::new(&mut input);
(
Name::from(name),
SpecifiedValue::parse(&mut parser).unwrap(),
)
})
.collect::<Vec<_>>();
let env = CssEnvironment;
let mut builder = CustomPropertiesBuilder::new(inherited, &env);
@ -31,14 +37,11 @@ fn cascade(
#[bench]
fn cascade_custom_simple(b: &mut Bencher) {
b.iter(|| {
let parent = cascade(&[
("foo", "10px"),
("bar", "100px"),
], None);
let parent = cascade(&[("foo", "10px"), ("bar", "100px")], None);
test::black_box(cascade(&[
("baz", "calc(40em + 4px)"),
("bazz", "calc(30em + 4px)"),
], parent.as_ref()))
test::black_box(cascade(
&[("baz", "calc(40em + 4px)"), ("bazz", "calc(30em + 4px)")],
parent.as_ref(),
))
})
}