3 #![warn(clippy::match_result_ok)]
4 #![allow(clippy::boxed_local)]
9 fn str_to_int(x: &str) -> i32 {
10 if let Some(y) = x.parse().ok() { y } else { 0 }
13 fn str_to_int_ok(x: &str) -> i32 {
14 if let Ok(y) = x.parse() { y } else { 0 }
18 fn strange_some_no_else(x: &str) -> i32 {
20 if let Some(y) = x . parse() . ok () {
27 // Checking `while` cases
34 fn next(&mut self) -> Result<i32, &str> {
45 let mut wat = Wat { counter: x };
46 while let Some(a) = wat.next().ok() {
52 let mut wat = Wat { counter: x };
53 while let Ok(a) = wat.next() {
58 fn base_3(test_func: Box<Result<i32, &str>>) {
59 // Expected to stay as is
60 while let Some(_b) = test_func.ok() {}