mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
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:
parent
5af0d7ca7c
commit
685e749cfc
56 changed files with 469 additions and 403 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue