mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Revert try -> r#try change.
Since we're in an inconsistent state because mako files weren't updated, and it's really really ugly.
This commit is contained in:
parent
155caba595
commit
212b3e1311
47 changed files with 326 additions and 336 deletions
|
@ -114,7 +114,7 @@ impl MediaCondition {
|
|||
|
||||
// ParenthesisBlock.
|
||||
let first_condition = Self::parse_paren_block(context, input)?;
|
||||
let operator = match input.r#try(Operator::parse) {
|
||||
let operator = match input.try(Operator::parse) {
|
||||
Ok(op) => op,
|
||||
Err(..) => return Ok(first_condition),
|
||||
};
|
||||
|
@ -133,7 +133,7 @@ impl MediaCondition {
|
|||
};
|
||||
|
||||
loop {
|
||||
if input.r#try(|i| i.expect_ident_matching(delim)).is_err() {
|
||||
if input.try(|i| i.expect_ident_matching(delim)).is_err() {
|
||||
return Ok(MediaCondition::Operation(
|
||||
conditions.into_boxed_slice(),
|
||||
operator,
|
||||
|
@ -159,7 +159,7 @@ impl MediaCondition {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
input.parse_nested_block(|input| {
|
||||
// Base case.
|
||||
if let Ok(inner) = input.r#try(|i| Self::parse(context, i)) {
|
||||
if let Ok(inner) = input.try(|i| Self::parse(context, i)) {
|
||||
return Ok(MediaCondition::InParens(Box::new(inner)));
|
||||
}
|
||||
let expr = MediaFeatureExpression::parse_in_parenthesis_block(context, input)?;
|
||||
|
|
|
@ -221,14 +221,14 @@ fn consume_operation_or_colon(input: &mut Parser) -> Result<Option<Operator>, ()
|
|||
Ok(Some(match first_delim {
|
||||
'=' => Operator::Equal,
|
||||
'>' => {
|
||||
if input.r#try(|i| i.expect_delim('=')).is_ok() {
|
||||
if input.try(|i| i.expect_delim('=')).is_ok() {
|
||||
Operator::GreaterThanEqual
|
||||
} else {
|
||||
Operator::GreaterThan
|
||||
}
|
||||
},
|
||||
'<' => {
|
||||
if input.r#try(|i| i.expect_delim('=')).is_ok() {
|
||||
if input.try(|i| i.expect_delim('=')).is_ok() {
|
||||
Operator::LessThanEqual
|
||||
} else {
|
||||
Operator::LessThan
|
||||
|
@ -350,7 +350,7 @@ impl MediaFeatureExpression {
|
|||
}
|
||||
}
|
||||
|
||||
let operator = input.r#try(consume_operation_or_colon);
|
||||
let operator = input.try(consume_operation_or_colon);
|
||||
let operator = match operator {
|
||||
Err(..) => {
|
||||
// If there's no colon, this is a media query of the
|
||||
|
|
|
@ -125,8 +125,8 @@ impl MediaQuery {
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let (qualifier, explicit_media_type) = input
|
||||
.r#try(|input| -> Result<_, ()> {
|
||||
let qualifier = input.r#try(Qualifier::parse).ok();
|
||||
.try(|input| -> Result<_, ()> {
|
||||
let qualifier = input.try(Qualifier::parse).ok();
|
||||
let ident = input.expect_ident().map_err(|_| ())?;
|
||||
let media_type = MediaQueryType::parse(&ident)?;
|
||||
Ok((qualifier, Some(media_type)))
|
||||
|
@ -135,7 +135,7 @@ impl MediaQuery {
|
|||
|
||||
let condition = if explicit_media_type.is_none() {
|
||||
Some(MediaCondition::parse(context, input)?)
|
||||
} else if input.r#try(|i| i.expect_ident_matching("and")).is_ok() {
|
||||
} else if input.try(|i| i.expect_ident_matching("and")).is_ok() {
|
||||
Some(MediaCondition::parse_disallow_or(context, input)?)
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue