From 42787ec700b22f43c784e846a13db96ae9c7109b Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Tue, 17 Mar 2020 10:10:42 -0400 Subject: [PATCH] proper error message in `unit()` when not given number --- src/builtin/meta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtin/meta.rs b/src/builtin/meta.rs index 66abf13..9145b41 100644 --- a/src/builtin/meta.rs +++ b/src/builtin/meta.rs @@ -47,7 +47,7 @@ pub(crate) fn register(f: &mut HashMap) { 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)) }),