mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-11 07:34:18 +00:00
16 lines
607 B
Text
16 lines
607 B
Text
error: .or(Some(…)).unwrap() found
|
|
--> $DIR/or_then_unwrap.rs:22:20
|
|
|
|
|
LL | let _ = option.or(Some("fallback")).unwrap(); // should trigger lint
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or(...)`
|
|
|
|
|
= note: `-D clippy::or-then-unwrap` implied by `-D warnings`
|
|
|
|
error: .or(Ok(…)).unwrap() found
|
|
--> $DIR/or_then_unwrap.rs:25:20
|
|
|
|
|
LL | let _ = result.or::<&str>(Ok("fallback")).unwrap(); // should trigger lint
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or(...)`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|