proper error message in unit()
when not given number
This commit is contained in:
parent
3b5dd73a65
commit
42787ec700
@ -47,7 +47,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
||||
max_args!(args, 1);
|
||||
let unit = match arg!(args, 0, "number") {
|
||||
Value::Dimension(_, u) => u.to_string(),
|
||||
_ => String::new(),
|
||||
v => return Err(format!("$number: {} is not a number.", v).into()),
|
||||
};
|
||||
Ok(Value::Ident(unit, QuoteKind::Double))
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user