diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-08 15:08:26 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-08 15:45:14 +0200 |
| commit | 712c00ecb72b67da2c0788e5d3eb4dcc6366b2a7 (patch) | |
| tree | f5d7ef4341a4728c980d020cc173fa6bb70feaff /src/library/utility/math.rs | |
| parent | 977ac77e6a3298be2644a8231e93acbef9f7f396 (diff) | |
Em units
Diffstat (limited to 'src/library/utility/math.rs')
| -rw-r--r-- | src/library/utility/math.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/library/utility/math.rs b/src/library/utility/math.rs index 272ececa..63ec5e55 100644 --- a/src/library/utility/math.rs +++ b/src/library/utility/math.rs @@ -37,12 +37,11 @@ pub fn abs(_: &mut Context, args: &mut Args) -> TypResult<Value> { Ok(match v { Value::Int(v) => Value::Int(v.abs()), Value::Float(v) => Value::Float(v.abs()), - Value::Length(v) => Value::Length(v.abs()), Value::Angle(v) => Value::Angle(v.abs()), Value::Ratio(v) => Value::Ratio(v.abs()), Value::Fraction(v) => Value::Fraction(v.abs()), - Value::Relative(_) => { - bail!(span, "cannot take absolute value of a relative length") + Value::Length(_) | Value::Relative(_) => { + bail!(span, "cannot take absolute value of a length") } v => bail!(span, "expected numeric value, found {}", v.type_name()), }) |
