mirror of
https://github.com/servo/servo.git
synced 2025-08-20 12:55:33 +01:00
style: Fix some manual occurrences of try().
Depends on D80099 Differential Revision: https://phabricator.services.mozilla.com/D80100
This commit is contained in:
parent
3884328ce3
commit
c578a82adc
1 changed files with 9 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue