const functions should not trigger or_fun_call #6943
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Lint name: or_fun_call
I tried this code:
I expected to see this happen: As str::len is a const function, it is inlined as a usize. So the suggestion to use
.unwrap_or_else()
introduces more overhead than is needed.Instead, this happened: The lint is triggered
Meta
cargo clippy -V
:clippy 0.1.52 (f5d8117 2021-03-16)
rustc -Vv
:The text was updated successfully, but these errors were encountered: