rust/tests/ui/unnecessary_literal_unwrap.fixed
Pavan Kumar Sunkara 69af0e13b2 Recognize Err
2023-06-12 16:19:26 +01:00

39 lines
609 B
Rust

//run-rustfix
#![warn(clippy::unnecessary_literal_unwrap)]
#![allow(clippy::unnecessary_lazy_evaluations)]
fn unwrap_option() {
let _val = 1;
let _val = 1;
}
fn unwrap_result_ok() {
let _val = 1;
let _val = 1;
}
fn unwrap_result_err() {
let _val = 1;
let _val = 1;
}
fn unwrap_methods_option() {
let _val = 1;
let _val = 1;
let _val = 1;
}
fn unwrap_methods_result() {
let _val = 1;
let _val = 1;
let _val = 1;
}
fn main() {
unwrap_option();
unwrap_result_ok();
unwrap_result_err();
unwrap_methods_option();
unwrap_methods_result();
}