31 lines
468 B
Rust
31 lines
468 B
Rust
//run-rustfix
|
|
#![warn(clippy::unnecessary_literal_unwrap)]
|
|
|
|
fn unwrap_option() {
|
|
let _val = 1;
|
|
let _val = 1;
|
|
}
|
|
|
|
fn unwrap_result() {
|
|
let _val = 1;
|
|
let _val = 1;
|
|
// let val = Err(1).unwrap_err();
|
|
}
|
|
|
|
fn unwrap_methods_option() {
|
|
let _val = 1;
|
|
let _val = 1;
|
|
}
|
|
|
|
fn unwrap_methods_result() {
|
|
let _val = 1;
|
|
let _val = 1;
|
|
}
|
|
|
|
fn main() {
|
|
unwrap_option();
|
|
unwrap_result();
|
|
unwrap_methods_option();
|
|
unwrap_methods_result();
|
|
}
|