You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warning: redundant pattern matching, consider using `is_some()`
--> src/main.rs:4:20
|
4 | if let Some($pat) = $x {}
| _____________- ^^^^^^^^^^
5 | | };
6 | | }
7 | |
8 | | if_let_in_macro!(_, Some(42));
| | ------------------------------
| |_____|__________________________|
| | help: try this: `if Some(42).is_some()`
| in this macro invocation
|
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
I believe this is wrong as it's not always fixable in macros
I tried this code:
Macro is external to the crate in actual code.
I expected to see this happen: No complaints
Instead, this happened:
I believe this is wrong as it's not always fixable in macros
Meta
cargo clippy -V
: clippy 0.0.212 (f3c923a 2020-09-17)rustc -Vv
:Backtrace
The text was updated successfully, but these errors were encountered: