Skip to content

Commit

Permalink
style: Fix some manual occurrences of try().
Browse files Browse the repository at this point in the history
Depends on D80099

Differential Revision: https://phabricator.services.mozilla.com/D80100
  • Loading branch information
emilio committed Jun 18, 2020
1 parent 3884328 commit c578a82
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions components/style/values/specified/effects.rs
Expand Up @@ -149,18 +149,17 @@ impl Parse for BoxShadow {
}
}
if lengths.is_none() {
let value = input.try::<_, _, ParseError>(|i| {
let value = input.try_parse::<_, _, ParseError>(|i| {
let horizontal = Length::parse(context, i)?;
let vertical = Length::parse(context, i)?;
let (blur, spread) = match i
.try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
{
Ok(blur) => {
let spread = i.try_parse(|i| Length::parse(context, i)).ok();
(Some(blur.into()), spread)
},
Err(_) => (None, None),
};
let (blur, spread) =
match i.try_parse(|i| Length::parse_non_negative(context, i)) {
Ok(blur) => {
let spread = i.try_parse(|i| Length::parse(context, i)).ok();
(Some(blur.into()), spread)
},
Err(_) => (None, None),
};
Ok((horizontal, vertical, blur, spread))
});
if let Ok(value) = value {
Expand Down

0 comments on commit c578a82

Please sign in to comment.