mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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
|
@ -55,7 +55,7 @@ where
|
|||
Parse: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result<T, ParseError<'i>>,
|
||||
{
|
||||
let first = parse(context, input)?;
|
||||
let second = if let Ok(second) = input.try(|i| parse(context, i)) {
|
||||
let second = if let Ok(second) = input.try_parse(|i| parse(context, i)) {
|
||||
second
|
||||
} else {
|
||||
// <first>
|
||||
|
@ -66,13 +66,13 @@ where
|
|||
first,
|
||||
));
|
||||
};
|
||||
let third = if let Ok(third) = input.try(|i| parse(context, i)) {
|
||||
let third = if let Ok(third) = input.try_parse(|i| parse(context, i)) {
|
||||
third
|
||||
} else {
|
||||
// <first> <second>
|
||||
return Ok(Self::new(first.clone(), second.clone(), first, second));
|
||||
};
|
||||
let fourth = if let Ok(fourth) = input.try(|i| parse(context, i)) {
|
||||
let fourth = if let Ok(fourth) = input.try_parse(|i| parse(context, i)) {
|
||||
fourth
|
||||
} else {
|
||||
// <first> <second> <third>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue