This commit is contained in:
ConnorSkees 2020-02-16 15:03:28 -05:00
parent 639fa99abc
commit 2b3e2ce34c
2 changed files with 14 additions and 8 deletions

View File

@ -29,10 +29,20 @@ macro_rules! max_args {
($args:ident, $count:literal) => {
if $args.len() > $count {
if $count > 1 {
return Err(format!("Only {} arguments allowed, but {} were passed.", $count, $args.len()).into());
return Err(format!(
"Only {} arguments allowed, but {} were passed.",
$count,
$args.len()
)
.into());
} else {
return Err(format!("Only {} argument allowed, but {} were passed.", $count, $args.len()).into());
return Err(format!(
"Only {} argument allowed, but {} were passed.",
$count,
$args.len()
)
.into());
}
}
};
}
}

View File

@ -130,8 +130,4 @@ test!(
"a {\n color:red\n}\n",
"a {\n color: red;\n}\n"
);
test!(
removes_null_value,
"a {\n color: null;\n}\n",
""
);
test!(removes_null_value, "a {\n color: null;\n}\n", "");