Properly conjugate 'arguments' when more than 1 is allowed
This commit is contained in:
parent
0aac40441d
commit
e886f5476b
@ -28,7 +28,11 @@ macro_rules! decl {
|
|||||||
macro_rules! max_args {
|
macro_rules! max_args {
|
||||||
($args:ident, $count:literal) => {
|
($args:ident, $count:literal) => {
|
||||||
if $args.len() > $count {
|
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());
|
return Err(format!("Only {} argument allowed, but {} were passed.", $count, $args.len()).into());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user