mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -109,7 +109,7 @@ impl Parse for BoxShadow {
|
|||
loop {
|
||||
if !inset {
|
||||
if input
|
||||
.r#try(|input| input.expect_ident_matching("inset"))
|
||||
.try(|input| input.expect_ident_matching("inset"))
|
||||
.is_ok()
|
||||
{
|
||||
inset = true;
|
||||
|
@ -117,14 +117,14 @@ impl Parse for BoxShadow {
|
|||
}
|
||||
}
|
||||
if lengths.is_none() {
|
||||
let value = input.r#try::<_, _, ParseError>(|i| {
|
||||
let value = input.try::<_, _, ParseError>(|i| {
|
||||
let horizontal = Length::parse(context, i)?;
|
||||
let vertical = Length::parse(context, i)?;
|
||||
let (blur, spread) = match i
|
||||
.r#try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
|
||||
.try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
|
||||
{
|
||||
Ok(blur) => {
|
||||
let spread = i.r#try(|i| Length::parse(context, i)).ok();
|
||||
let spread = i.try(|i| Length::parse(context, i)).ok();
|
||||
(Some(blur.into()), spread)
|
||||
},
|
||||
Err(_) => (None, None),
|
||||
|
@ -137,7 +137,7 @@ impl Parse for BoxShadow {
|
|||
}
|
||||
}
|
||||
if color.is_none() {
|
||||
if let Ok(value) = input.r#try(|i| Color::parse(context, i)) {
|
||||
if let Ok(value) = input.try(|i| Color::parse(context, i)) {
|
||||
color = Some(value);
|
||||
continue;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ impl Parse for Filter {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
if let Ok(url) = input.r#try(|i| SpecifiedUrl::parse(context, i)) {
|
||||
if let Ok(url) = input.try(|i| SpecifiedUrl::parse(context, i)) {
|
||||
return Ok(GenericFilter::Url(url));
|
||||
}
|
||||
}
|
||||
|
@ -253,12 +253,12 @@ impl Parse for SimpleShadow {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let color = input.r#try(|i| Color::parse(context, i)).ok();
|
||||
let color = input.try(|i| Color::parse(context, i)).ok();
|
||||
let horizontal = Length::parse(context, input)?;
|
||||
let vertical = Length::parse(context, input)?;
|
||||
let blur = input.r#try(|i| Length::parse_non_negative(context, i)).ok();
|
||||
let blur = input.try(|i| Length::parse_non_negative(context, i)).ok();
|
||||
let blur = blur.map(NonNegative::<Length>);
|
||||
let color = color.or_else(|| input.r#try(|i| Color::parse(context, i)).ok());
|
||||
let color = color.or_else(|| input.try(|i| Color::parse(context, i)).ok());
|
||||
|
||||
Ok(SimpleShadow {
|
||||
color,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue