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

@ -48,7 +48,8 @@ macro_rules! parse_svg_length {
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if let Ok(lp) = input.try(|i| <$lp>::parse_quirky(context, i, AllowQuirks::Always))
if let Ok(lp) =
input.try_parse(|i| <$lp>::parse_quirky(context, i, AllowQuirks::Always))
{
return Ok(generic::SVGLength::LengthPercentage(lp));
}
@ -71,7 +72,7 @@ impl Parse for SVGStrokeDashArray {
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if let Ok(values) = input.try(|i| {
if let Ok(values) = input.try_parse(|i| {
CommaWithSpace::parse(i, |i| {
NonNegativeLengthPercentage::parse_quirky(context, i, AllowQuirks::Always)
})
@ -161,7 +162,7 @@ impl Parse for SVGPaintOrder {
_context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<SVGPaintOrder, ParseError<'i>> {
if let Ok(()) = input.try(|i| i.expect_ident_matching("normal")) {
if let Ok(()) = input.try_parse(|i| i.expect_ident_matching("normal")) {
return Ok(SVGPaintOrder::normal());
}
@ -172,7 +173,7 @@ impl Parse for SVGPaintOrder {
let mut pos = 0;
loop {
let result: Result<_, ParseError> = input.try(|input| {
let result: Result<_, ParseError> = input.try_parse(|input| {
try_match_ident_ignore_ascii_case! { input,
"fill" => Ok(PaintOrder::Fill),
"stroke" => Ok(PaintOrder::Stroke),