this doesn't work
match v {
true => -b?,
false => None,
}
but this does
match v {
true => {
let neg = -b?;
neg
}
false => None,
}
when running cargo clippy:
18 | let neg = -b?;
| -------------- unnecessary `let` binding
19 | neg
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
18 ~
19 ~ -b?
running clippy --fix fails.
sandbox link
rustc --version --verbose:
rustc 1.71.0 (8ede3aae2 2023-07-12)
binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: x86_64-unknown-linux-gnu
release: 1.71.0
LLVM version: 16.0.5
this doesn't work
but this does
when running
cargo clippy:running
clippy --fixfails.sandbox link
rustc --version --verbose: