mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +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
|
@ -358,7 +358,7 @@ pub enum GenericFontFamily {
|
|||
impl SingleFontFamily {
|
||||
/// Parse a font-family value.
|
||||
pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(value) = input.try(|i| i.expect_string_cloned()) {
|
||||
if let Ok(value) = input.try_parse(|i| i.expect_string_cloned()) {
|
||||
return Ok(SingleFontFamily::FamilyName(FamilyName {
|
||||
name: Atom::from(&*value),
|
||||
syntax: FontFamilyNameSyntax::Quoted,
|
||||
|
@ -393,7 +393,7 @@ impl SingleFontFamily {
|
|||
value.push(' ');
|
||||
value.push_str(&ident);
|
||||
}
|
||||
while let Ok(ident) = input.try(|i| i.expect_ident_cloned()) {
|
||||
while let Ok(ident) = input.try_parse(|i| i.expect_ident_cloned()) {
|
||||
serialize_quoted = serialize_quoted || ident.contains(' ');
|
||||
value.push(' ');
|
||||
value.push_str(&ident);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue