Commit graph

6 commits

Author SHA1 Message Date
Thibaut Vandervelden
f743fec6b0 fix: false positive for option_env! in ifs
Clippy had a false positive for with `ifs_same_cond` when two
if-let expressions have an `option_env!` macro. The fix is similar to the
`env!` macro fix.

The following example had a clippy error:

```rust
if let Some(env1) = option_env!("ENV1") {
    // ...
} else if let Some(env2) = option_env!("ENV2") {
    // ...
}
```

See https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=01b85c61b56ddd900117fb247af04824

changelog: Fix [`ifs_same_cond`] false positive when using `option_env!` in if-let expressions.
2023-07-20 12:04:24 +02:00
Centri3
26f50395ba Add needless_if lint 2023-06-10 06:51:03 -05:00
J-ZhengLi
8a9492aa03 enhance [ifs_same_cond] to lint same immutable method calls as well 2023-03-13 20:13:56 +08:00
Maybe Waffle
8dfbad9e49 bless clippy 2022-10-01 10:03:06 +00:00
Yuki Okushi
07e33633a3 Update stderrs 2020-01-07 18:38:12 +09:00
Philipp Hansch
3b035373b2
UI test cleanup: Extract ifs_same_cond tests 2019-01-02 07:59:48 +01:00