2022-03-20 17:43:17 -05:00
|
|
|
error: found `.or(Some(…)).unwrap()`
|
2022-03-18 17:18:36 -05:00
|
|
|
--> $DIR/or_then_unwrap.rs:24:20
|
2022-03-17 12:57:28 -05:00
|
|
|
|
|
|
|
|
LL | let _ = option.or(Some("fallback")).unwrap(); // should trigger lint
|
2022-03-18 17:18:36 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
|
2022-03-17 12:57:28 -05:00
|
|
|
|
|
2022-03-17 19:04:33 -05:00
|
|
|
= note: `-D clippy::or-then-unwrap` implied by `-D warnings`
|
2022-03-17 12:57:28 -05:00
|
|
|
|
2022-03-20 17:43:17 -05:00
|
|
|
error: found `.or(Ok(…)).unwrap()`
|
2022-03-18 17:18:36 -05:00
|
|
|
--> $DIR/or_then_unwrap.rs:27:20
|
2022-03-17 12:57:28 -05:00
|
|
|
|
|
|
|
|
LL | let _ = result.or::<&str>(Ok("fallback")).unwrap(); // should trigger lint
|
2022-03-18 17:18:36 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
|
2022-03-17 12:57:28 -05:00
|
|
|
|
2022-03-20 17:43:17 -05:00
|
|
|
error: found `.or(Some(…)).unwrap()`
|
2022-03-19 12:17:43 -05:00
|
|
|
--> $DIR/or_then_unwrap.rs:31:31
|
|
|
|
|
|
|
|
|
LL | let _ = option.map(|v| v).or(Some("fallback")).unwrap().to_string().chars(); // should trigger lint
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2022-03-17 12:57:28 -05:00
|
|
|
|