mirror of
https://github.com/servo/servo.git
synced 2025-08-23 14:25: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() {
|
if lengths.is_none() {
|
||||||
let value = input.try::<_, _, ParseError>(|i| {
|
let value = input.try_parse::<_, _, ParseError>(|i| {
|
||||||
let horizontal = Length::parse(context, i)?;
|
let horizontal = Length::parse(context, i)?;
|
||||||
let vertical = Length::parse(context, i)?;
|
let vertical = Length::parse(context, i)?;
|
||||||
let (blur, spread) = match i
|
let (blur, spread) =
|
||||||
.try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
|
match i.try_parse(|i| Length::parse_non_negative(context, i)) {
|
||||||
{
|
Ok(blur) => {
|
||||||
Ok(blur) => {
|
let spread = i.try_parse(|i| Length::parse(context, i)).ok();
|
||||||
let spread = i.try_parse(|i| Length::parse(context, i)).ok();
|
(Some(blur.into()), spread)
|
||||||
(Some(blur.into()), spread)
|
},
|
||||||
},
|
Err(_) => (None, None),
|
||||||
Err(_) => (None, None),
|
};
|
||||||
};
|
|
||||||
Ok((horizontal, vertical, blur, spread))
|
Ok((horizontal, vertical, blur, spread))
|
||||||
});
|
});
|
||||||
if let Ok(value) = value {
|
if let Ok(value) = value {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue