mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
cargo fix --edition
This commit is contained in:
parent
e1fcffb336
commit
a15d33a10e
197 changed files with 1414 additions and 1380 deletions
|
@ -6,22 +6,22 @@
|
|||
//!
|
||||
//! [counter-style]: https://drafts.csswg.org/css-counter-styles/
|
||||
|
||||
use crate::error_reporting::ContextualParseError;
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
||||
use crate::str::CssStringWriter;
|
||||
use crate::values::specified::Integer;
|
||||
use crate::values::CustomIdent;
|
||||
use crate::Atom;
|
||||
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser};
|
||||
use cssparser::{CowRcStr, Parser, SourceLocation, Token};
|
||||
use error_reporting::ContextualParseError;
|
||||
use parser::{Parse, ParserContext};
|
||||
use selectors::parser::SelectorParseErrorKind;
|
||||
use shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
|
||||
use std::fmt::{self, Write};
|
||||
use std::mem;
|
||||
use std::num::Wrapping;
|
||||
use std::ops::Range;
|
||||
use str::CssStringWriter;
|
||||
use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
|
||||
use style_traits::{StyleParseErrorKind, ToCss};
|
||||
use values::specified::Integer;
|
||||
use values::CustomIdent;
|
||||
use Atom;
|
||||
|
||||
/// Parse a counter style name reference.
|
||||
///
|
||||
|
@ -370,7 +370,7 @@ impl Parse for System {
|
|||
"symbolic" => Ok(System::Symbolic),
|
||||
"additive" => Ok(System::Additive),
|
||||
"fixed" => {
|
||||
let first_symbol_value = input.try(|i| Integer::parse(context, i)).ok();
|
||||
let first_symbol_value = input.r#try(|i| Integer::parse(context, i)).ok();
|
||||
Ok(System::Fixed { first_symbol_value: first_symbol_value })
|
||||
}
|
||||
"extends" => {
|
||||
|
@ -457,7 +457,7 @@ impl Parse for Negative {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
Ok(Negative(
|
||||
Symbol::parse(context, input)?,
|
||||
input.try(|input| Symbol::parse(context, input)).ok(),
|
||||
input.r#try(|input| Symbol::parse(context, input)).ok(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ impl Parse for Ranges {
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if input
|
||||
.try(|input| input.expect_ident_matching("auto"))
|
||||
.r#try(|input| input.expect_ident_matching("auto"))
|
||||
.is_ok()
|
||||
{
|
||||
Ok(Ranges(Vec::new()))
|
||||
|
@ -512,7 +512,7 @@ fn parse_bound<'i, 't>(
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<CounterBound, ParseError<'i>> {
|
||||
if let Ok(integer) = input.try(|input| Integer::parse(context, input)) {
|
||||
if let Ok(integer) = input.r#try(|input| Integer::parse(context, input)) {
|
||||
return Ok(CounterBound::Integer(integer));
|
||||
}
|
||||
input.expect_ident_matching("infinite")?;
|
||||
|
@ -556,7 +556,7 @@ impl Parse for Pad {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let pad_with = input.try(|input| Symbol::parse(context, input));
|
||||
let pad_with = input.r#try(|input| Symbol::parse(context, input));
|
||||
let min_length = Integer::parse_non_negative(context, input)?;
|
||||
let pad_with = pad_with.or_else(|_| Symbol::parse(context, input))?;
|
||||
Ok(Pad(min_length, pad_with))
|
||||
|
@ -588,7 +588,7 @@ impl Parse for Symbols {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
let mut symbols = Vec::new();
|
||||
loop {
|
||||
if let Ok(s) = input.try(|input| Symbol::parse(context, input)) {
|
||||
if let Ok(s) = input.r#try(|input| Symbol::parse(context, input)) {
|
||||
symbols.push(s)
|
||||
} else {
|
||||
if symbols.is_empty() {
|
||||
|
@ -640,7 +640,7 @@ impl Parse for AdditiveTuple {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let symbol = input.try(|input| Symbol::parse(context, input));
|
||||
let symbol = input.r#try(|input| Symbol::parse(context, input));
|
||||
let weight = Integer::parse_non_negative(context, input)?;
|
||||
let symbol = symbol.or_else(|_| Symbol::parse(context, input))?;
|
||||
Ok(AdditiveTuple {
|
||||
|
@ -673,7 +673,7 @@ impl Parse for SpeakAs {
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let mut is_spell_out = false;
|
||||
let result = input.try(|input| {
|
||||
let result = input.r#try(|input| {
|
||||
let ident = input.expect_ident().map_err(|_| ())?;
|
||||
match_ignore_ascii_case! { &*ident,
|
||||
"auto" => Ok(SpeakAs::Auto),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue