From d8db9374703829fabb6af18930ab01572208b7c6 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Tue, 10 Mar 2020 21:53:21 -0400 Subject: [PATCH] reorder macro params --- src/builtin/color/other.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/builtin/color/other.rs b/src/builtin/color/other.rs index 03faa76..bcac7f1 100644 --- a/src/builtin/color/other.rs +++ b/src/builtin/color/other.rs @@ -7,17 +7,17 @@ use crate::units::Unit; use crate::value::{Number, Value}; macro_rules! opt_arg { - ($args:ident, $name:ident, $arg:literal, $high:literal, $low:literal) => { + ($args:ident, $name:ident, $arg:literal, $low:literal, $high:literal) => { let $name = match arg!($args, -1, $arg = Value::Null) { - Value::Dimension(n, u) => Some(bound!($arg, n, u, $high, $low)), + Value::Dimension(n, u) => Some(bound!($arg, n, u, $low, $high)), Value::Null => None, v => return Err(format!("${}: {} is not a number.", $arg, v).into()), }; }; - (scale: $args:ident, $name:ident, $arg:literal, $high:literal, $low:literal) => { + (scale: $args:ident, $name:ident, $arg:literal, $low:literal, $high:literal) => { let $name = match arg!($args, -1, $arg = Value::Null) { Value::Dimension(n, Unit::Percent) => { - Some(bound!($arg, n, Unit::Percent, $high, $low) / Number::from(100)) + Some(bound!($arg, n, Unit::Percent, $low, $high) / Number::from(100)) } v @ Value::Dimension(..) => { return Err(format!("${}: Expected {} to have unit \"%\".", $arg, v).into()) @@ -26,9 +26,9 @@ macro_rules! opt_arg { v => return Err(format!("${}: {} is not a number.", $arg, v).into()), }; }; - (hsl: $args:ident, $name:ident, $arg:literal, $high:literal, $low:literal) => { + (hsl: $args:ident, $name:ident, $arg:literal, $low:literal, $high:literal) => { let $name = match arg!($args, -1, $arg = Value::Null) { - Value::Dimension(n, u) => Some(bound!($arg, n, u, $high, $low) / Number::from(100)), + Value::Dimension(n, u) => Some(bound!($arg, n, u, $low, $high) / Number::from(100)), Value::Null => None, v => return Err(format!("${}: {} is not a number.", $arg, v).into()), };