rust-clippy/tests/ui/unnecessary_literal_unwrap.fixed

19 lines
274 B
Rust
Raw Normal View History

2023-02-16 14:21:43 +00:00
//run-rustfix
#![warn(clippy::unnecessary_literal_unwrap)]
fn unwrap_option() {
2023-02-16 14:37:18 +00:00
let _val = 1;
let _val = 1;
}
fn unwrap_result() {
let _val = 1;
let _val = 1;
// let val = Err(1).unwrap_err();
2023-02-16 14:21:43 +00:00
}
fn main() {
unwrap_option();
2023-02-16 14:37:18 +00:00
unwrap_result();
2023-02-16 14:21:43 +00:00
}