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

@ -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| {