error arg-count
Неверное число аргументов.
What it means#
The call passes fewer or more arguments than the function has parameters (§6.1). Parameters with default values and a variadic last parameter ...xs: T may be omitted or repeated; all other parameters must be supplied.
Example#
fn add(a: i32, b: i32) -> i32 => a + b
fn main() {
let s = add(1) // <- arg-count
}error
arg-count
How to fix#
fn add(a: i32, b: i32) -> i32 => a + b
fn main() {
let s = add(1, 2)
}Pass every required argument, or give the missing parameter a default value in the declaration (b: i32 = 0).