2022-03-24 13:50:04 +00:00
|
|
|
error: found `.or(Some(…)).unwrap()`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/or_then_unwrap.rs:22:20
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
LL | let _ = option.or(Some("fallback")).unwrap(); // should trigger lint
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or("fallback")`
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::or-then-unwrap` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::or_then_unwrap)]`
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
error: found `.or(Ok(…)).unwrap()`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/or_then_unwrap.rs:25:20
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
LL | let _ = result.or::<&str>(Ok("fallback")).unwrap(); // should trigger lint
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or("fallback")`
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
error: found `.or(Some(…)).unwrap()`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/or_then_unwrap.rs:29:31
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
|
LL | let _ = option.map(|v| v).or(Some("fallback")).unwrap().to_string().chars(); // should trigger lint
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or("fallback")`
|
2022-03-24 13:50:04 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|