Open
Description
pub fn main() {
let x: Option<()> = Some(());
assert_eq!(x.unwrap(), ());
}
Clippy warns here ``assert_eq of unit values detected. This will always succeed
, however this code will actually check and panic if x is None.
Can we suggest to replace it with
assert!(x.is_some())
in this case?
Found in cargo codebase of cargo.
clippy 0.0.212 (5cb9833 2019-10-08)