The boolean example is particularly bad though; I believe it is even in the Rust API Guidelines to not pass booleans in your APIs precisely for that reason. The advice which I agree with is to make it properly typed
https://rust-lang.github.io/api-guidelines/type-safety.html?...