style: Switch all callsites of try() to try_parse() in the style crate.

Fully automated via:

  $ rg -l '\.try\(' | xargs sed -i 's/\.try(/.try_parse(/g'
  $ cd servo/components/style && cargo +nightly fmt

Differential Revision: https://phabricator.services.mozilla.com/D80099
This commit is contained in:
Emilio Cobos Álvarez 2020-06-17 22:27:37 +00:00
parent 5af0d7ca7c
commit 685e749cfc
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
56 changed files with 469 additions and 403 deletions

View file

@ -59,19 +59,19 @@
% endfor
loop {
if background_color.is_none() {
if let Ok(value) = input.try(|i| Color::parse(context, i)) {
if let Ok(value) = input.try_parse(|i| Color::parse(context, i)) {
background_color = Some(value);
continue
}
}
if position.is_none() {
if let Ok(value) = input.try(|input| {
if let Ok(value) = input.try_parse(|input| {
Position::parse_three_value_quirky(context, input, AllowQuirks::No)
}) {
position = Some(value);
// Parse background size, if applicable.
size = input.try(|input| {
size = input.try_parse(|input| {
input.expect_delim('/')?;
background_size::single_value::parse(context, input)
}).ok();
@ -81,7 +81,7 @@
}
% for name in "image repeat attachment origin clip".split():
if ${name}.is_none() {
if let Ok(value) = input.try(|input| background_${name}::single_value
if let Ok(value) = input.try_parse(|input| background_${name}::single_value
::parse(context, input)) {
${name} = Some(value);
continue