File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ pub(super) fn check<'tcx>(
21
21
let or_arg_content: Span ;
22
22
23
23
if is_type_diagnostic_item ( cx, ty, sym:: Option ) {
24
- title = ".or(Some(…)).unwrap() found " ;
24
+ title = "found ` .or(Some(…)).unwrap()` " ;
25
25
if let Some ( content) = get_content_if_is ( or_arg, "Some" ) {
26
26
or_arg_content = content;
27
27
} else {
28
28
return ;
29
29
}
30
30
} else if is_type_diagnostic_item ( cx, ty, sym:: Result ) {
31
- title = ".or(Ok(…)).unwrap() found " ;
31
+ title = "found ` .or(Ok(…)).unwrap()` " ;
32
32
if let Some ( content) = get_content_if_is ( or_arg, "Ok" ) {
33
33
or_arg_content = content;
34
34
} else {
Original file line number Diff line number Diff line change 1
- error: .or(Some(…)).unwrap() found
1
+ error: found ` .or(Some(…)).unwrap()`
2
2
--> $DIR/or_then_unwrap.rs:24:20
3
3
|
4
4
LL | let _ = option.or(Some("fallback")).unwrap(); // should trigger lint
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
6
6
|
7
7
= note: `-D clippy::or-then-unwrap` implied by `-D warnings`
8
8
9
- error: .or(Ok(…)).unwrap() found
9
+ error: found ` .or(Ok(…)).unwrap()`
10
10
--> $DIR/or_then_unwrap.rs:27:20
11
11
|
12
12
LL | let _ = result.or::<&str>(Ok("fallback")).unwrap(); // should trigger lint
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or("fallback")`
14
14
15
- error: .or(Some(…)).unwrap() found
15
+ error: found ` .or(Some(…)).unwrap()`
16
16
--> $DIR/or_then_unwrap.rs:31:31
17
17
|
18
18
LL | let _ = option.map(|v| v).or(Some("fallback")).unwrap().to_string().chars(); // should trigger lint
You can’t perform that action at this time.
0 commit comments