Closed
Description
Summary
....
Lint Name
unnecessary_lazy_evaluations
Reproducer
I tried this code:
// FromForm is from rocket (HTTP library)
#[derive(FromForm, Debug)]
pub struct CreateAlarm {
pub label: String,
}
I saw this happen:
warning: unnecessary closure used with `bool::then`
--> src/routes/alarm/create.rs:10:16
|
10 | pub label: String,
| ^^^^^^ help: use `then_some(..)` instead: `then_some(label)`
|
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
I expected to see this happen: nothing
Version
rustc 1.65.0-nightly (29e4a9ee0 2022-08-10)
binary: rustc
commit-hash: 29e4a9ee0253cd39e552a77f51f11f9a5f1c41e6
commit-date: 2022-08-10
host: aarch64-apple-darwin
release: 1.65.0-nightly
LLVM version: 14.0.6
Additional Labels
No response