Properly conjugate 'arguments' when more than 1 is allowed
@@ -28,7 +28,11 @@ macro_rules! decl {
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());
+ } else {
return Err(format!("Only {} argument allowed, but {} were passed.", $count, $args.len()).into());
}
+ }
};
}
\ No newline at end of file
