rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

or_fun_call: lint method calls inside map_or first arg

Open klensy opened this issue 4 months ago • 0 comments

blocked on rust-lang/rust-clippy#15073

Lint method calls inside map_or too, so for this, lint will be showed:

Some(4).map_or("asd".to_string().len() as i32, f);

previously it worked only for:

Some(4).map_or(slow_fun(), f);

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=bfcda42a6af446e69bc883a8b45eb13c

Sorry for multiple or_fun_call PRs.

changelog: [or_fun_call]: lint method calls inside map_or first arg

klensy avatar Jun 18 '25 10:06 klensy