mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +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
|
@ -75,10 +75,10 @@ impl Parse for ListStyleType {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(style) = input.try(|i| CounterStyle::parse(context, i)) {
|
||||
if let Ok(style) = input.try_parse(|i| CounterStyle::parse(context, i)) {
|
||||
return Ok(ListStyleType::CounterStyle(style));
|
||||
}
|
||||
if input.try(|i| i.expect_ident_matching("none")).is_ok() {
|
||||
if input.try_parse(|i| i.expect_ident_matching("none")).is_ok() {
|
||||
return Ok(ListStyleType::None);
|
||||
}
|
||||
Ok(ListStyleType::String(
|
||||
|
@ -155,14 +155,14 @@ impl Parse for Quotes {
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Quotes, ParseError<'i>> {
|
||||
if input
|
||||
.try(|input| input.expect_ident_matching("auto"))
|
||||
.try_parse(|input| input.expect_ident_matching("auto"))
|
||||
.is_ok()
|
||||
{
|
||||
return Ok(Quotes::Auto);
|
||||
}
|
||||
|
||||
if input
|
||||
.try(|input| input.expect_ident_matching("none"))
|
||||
.try_parse(|input| input.expect_ident_matching("none"))
|
||||
.is_ok()
|
||||
{
|
||||
return Ok(Quotes::QuoteList(QuoteList::default()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue