if_then_some_else_none
invalid suggestion
#13407
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
if_then_some_else_none
is giving an invalid suggestion for the case below.The suggestion is invalid code.
Expected behaviour
While
(s == "1").then(|| true)
works, the suggestion should be(s == "1").then_some(true)
.See the emitted warning for the following function:
Version
The text was updated successfully, but these errors were encountered: