]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/or_then_unwrap.stderr
Rollup merge of #102581 - jyn514:src-detection, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / or_then_unwrap.stderr
1 error: found `.or(Some(…)).unwrap()`
2   --> $DIR/or_then_unwrap.rs:24:20
3    |
4 LL |     let _ = option.or(Some("fallback")).unwrap(); // should trigger lint
5    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
6    |
7    = note: `-D clippy::or-then-unwrap` implied by `-D warnings`
8
9 error: found `.or(Ok(…)).unwrap()`
10   --> $DIR/or_then_unwrap.rs:27:20
11    |
12 LL |     let _ = result.or::<&str>(Ok("fallback")).unwrap(); // should trigger lint
13    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
14
15 error: found `.or(Some(…)).unwrap()`
16   --> $DIR/or_then_unwrap.rs:31:31
17    |
18 LL |     let _ = option.map(|v| v).or(Some("fallback")).unwrap().to_string().chars(); // should trigger lint
19    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
20
21 error: aborting due to 3 previous errors
22