1 error: used unwrap or expect in a function that returns result or option
2 --> $DIR/unwrap_in_result.rs:22:5
4 LL | / fn bad_divisible_by_3(i_str: String) -> Result<bool, String> {
5 LL | | // checks whether a string represents a number divisible by 3
6 LL | | let i = i_str.parse::<i32>().unwrap();
13 = help: unwrap and expect should not be used in a function that returns result or option
14 note: potential non-recoverable error(s)
15 --> $DIR/unwrap_in_result.rs:24:17
17 LL | let i = i_str.parse::<i32>().unwrap();
18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 = note: `-D clippy::unwrap-in-result` implied by `-D warnings`
21 error: used unwrap or expect in a function that returns result or option
22 --> $DIR/unwrap_in_result.rs:32:5
24 LL | / fn example_option_expect(i_str: String) -> Option<bool> {
25 LL | | let i = i_str.parse::<i32>().expect("not a number");
26 LL | | if i % 3 == 0 {
27 LL | | return Some(true);
33 = help: unwrap and expect should not be used in a function that returns result or option
34 note: potential non-recoverable error(s)
35 --> $DIR/unwrap_in_result.rs:33:17
37 LL | let i = i_str.parse::<i32>().expect("not a number");
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 error: aborting due to 2 previous errors