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: You checked before that `unwrap_err()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> tests/delimiters.rs:51:32
|
51 | assert!(m.is_ok(), "{:?}", m.unwrap_err());
| --------- ^^^^^^^^^^^^^^
| |
| the check is happening here
|
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
I'm not sure if this is intended to act that way, but this is pretty common pattern in tests ("assert success or print the error otherwise).
Do not lint `unnecessary_unwrap` in external macros
Fixes#5131
I think we shouldn't lint `{panicking, unnecessary}_unwrap` in macros, not just `assert!`.
changelog: Fix false positive in `unnecessary_unwrap`
I think the warning explains it all:
I'm not sure if this is intended to act that way, but this is pretty common pattern in tests ("assert success or print the error otherwise).
The text was updated successfully, but these errors were encountered: