mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Simplify Number::parse_with_minimum.
This commit is contained in:
parent
372379428b
commit
1ce9758f90
1 changed files with 2 additions and 2 deletions
|
@ -538,8 +538,8 @@ impl Parse for Number {
|
|||
impl Number {
|
||||
fn parse_with_minimum(input: &mut Parser, min: CSSFloat) -> Result<Number, ()> {
|
||||
match parse_number(input) {
|
||||
Ok(value) if value < min => Err(()),
|
||||
value => value.map(Number),
|
||||
Ok(value) if value >= min => Ok(Number(value)),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue