RS.CLIPPY.FN_PARAMS_EXCESSIVE_BOOLS
Using too many bools in function parameters
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: fn_params_excessive_bools. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for excessive use of bools in function definitions.
Why is this bad?
Calls to such functions are confusing and error prone, because it's hard to remember argument order and you have no type system support to back you up. Using two-variant enums instead of bools often makes API easier to use.
Example
fn f(is_round: bool, is_hot: bool) { ... }
Use instead:
enum Shape {
Round,
Spiky,
}
enum Temperature {
Hot,
IceCold,
}
fn f(shape: Shape, temperature: Temperature) { ... }
Configuration
-
max-fn-params-bools: The maximum number of bool parameters a function can have(default:
3)