E0061type-check

This function takes X parameters but Y were supplied

Argument count mismatch at a call site.

Repro

fn greet(first: &str, last: &str) {
    println!("Hi {} {}", first, last);
}
greet("Ada");   // E0061: takes 2 arguments but 1 was supplied

Why

Rust does not insert defaults or tolerate missing arguments. The signature is the contract; the call must satisfy it exactly.

Fix

- Pass the missing arguments. - If the missing args are typically empty, refactor to take an Option<T> or split the function (greet_first, greet_full). - For ergonomic optional parameters, use a builder pattern. - For variable-arity, take a slice or a tuple instead of multiple parameters.

Patterns that solve this