Properly conjugate 'arguments' when more than 1 is allowed

This commit is contained in:
ConnorSkees 2020-02-16 12:39:48 -05:00
parent 0aac40441d
commit e886f5476b

View File

@ -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());
}
}
};
}