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
|
@ -122,7 +122,7 @@ macro_rules! impl_range {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
let first = $component::parse(context, input)?;
|
||||
let second = input
|
||||
.try(|input| $component::parse(context, input))
|
||||
.try_parse(|input| $component::parse(context, input))
|
||||
.unwrap_or_else(|_| first.clone());
|
||||
Ok($range(first, second))
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ impl Parse for FontStyle {
|
|||
GenericFontStyle::Italic => FontStyle::Italic,
|
||||
GenericFontStyle::Oblique(angle) => {
|
||||
let second_angle = input
|
||||
.try(|input| SpecifiedFontStyle::parse_angle(context, input))
|
||||
.try_parse(|input| SpecifiedFontStyle::parse_angle(context, input))
|
||||
.unwrap_or_else(|_| angle.clone());
|
||||
|
||||
FontStyle::Oblique(angle, second_angle)
|
||||
|
@ -383,7 +383,7 @@ impl Parse for Source {
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Source, ParseError<'i>> {
|
||||
if input
|
||||
.try(|input| input.expect_function_matching("local"))
|
||||
.try_parse(|input| input.expect_function_matching("local"))
|
||||
.is_ok()
|
||||
{
|
||||
return input
|
||||
|
@ -395,7 +395,7 @@ impl Parse for Source {
|
|||
|
||||
// Parsing optional format()
|
||||
let format_hints = if input
|
||||
.try(|input| input.expect_function_matching("format"))
|
||||
.try_parse(|input| input.expect_function_matching("format"))
|
||||
.is_ok()
|
||||
{
|
||||
input.parse_nested_block(|input| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue