mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -21,10 +21,10 @@ impl Parse for TimingFunction {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(keyword) = input.try(TimingKeyword::parse) {
|
||||
if let Ok(keyword) = input.try_parse(TimingKeyword::parse) {
|
||||
return Ok(GenericTimingFunction::Keyword(keyword));
|
||||
}
|
||||
if let Ok(ident) = input.try(|i| i.expect_ident_cloned()) {
|
||||
if let Ok(ident) = input.try_parse(|i| i.expect_ident_cloned()) {
|
||||
let position = match_ignore_ascii_case! { &ident,
|
||||
"step-start" => StepPosition::Start,
|
||||
"step-end" => StepPosition::End,
|
||||
|
@ -57,7 +57,7 @@ impl Parse for TimingFunction {
|
|||
},
|
||||
"steps" => {
|
||||
let steps = Integer::parse_positive(context, i)?;
|
||||
let position = i.try(|i| {
|
||||
let position = i.try_parse(|i| {
|
||||
i.expect_comma()?;
|
||||
StepPosition::parse(context, i)
|
||||
}).unwrap_or(StepPosition::End);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue