2023-05-31 17:47:10 +00:00
|
|
|
#![allow(unused, clippy::unnecessary_literal_unwrap)]
|
2022-10-21 21:35:39 +00:00
|
|
|
|
2022-03-29 17:19:16 +00:00
|
|
|
struct MyTypeNonDebug;
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
struct MyTypeDebug;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let test_debug: Result<MyTypeDebug, u32> = Ok(MyTypeDebug);
|
|
|
|
test_debug.expect_err("Testing debug type");
|
|
|
|
|
|
|
|
let test_non_debug: Result<MyTypeNonDebug, u32> = Ok(MyTypeNonDebug);
|
|
|
|
test_non_debug.err().expect("Testing non debug type");
|
|
|
|
}
|
2022-10-21 21:35:39 +00:00
|
|
|
|
2022-11-19 12:50:02 +00:00
|
|
|
#[clippy::msrv = "1.16"]
|
2022-10-21 21:35:39 +00:00
|
|
|
fn msrv_1_16() {
|
|
|
|
let x: Result<u32, &str> = Ok(16);
|
|
|
|
x.err().expect("16");
|
|
|
|
}
|
|
|
|
|
2022-11-19 12:50:02 +00:00
|
|
|
#[clippy::msrv = "1.17"]
|
2022-10-21 21:35:39 +00:00
|
|
|
fn msrv_1_17() {
|
|
|
|
let x: Result<u32, &str> = Ok(17);
|
|
|
|
x.expect_err("17");
|
|
|
|
}
|