blob: 0e134ba3ccba2f6823e6fbc88c99c3d5a097dce7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:9:5
|
LL | x.parse::<u32>().ok();
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-result-ok` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unused_result_ok)]`
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL - x.parse::<u32>().ok();
LL + let _ = x.parse::<u32>();
|
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:19:5
|
LL | x . parse::<i32>() . ok ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL - x . parse::<i32>() . ok ();
LL + let _ = x . parse::<i32>();
|
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:37:5
|
LL | v!().ok();
| ^^^^^^^^^
|
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL - v!().ok();
LL + let _ = v!();
|
error: ignoring a result with `.ok()` is misleading
--> tests/ui/unused_result_ok.rs:31:9
|
LL | Ok::<(), ()>(()).ok();
| ^^^^^^^^^^^^^^^^^^^^^
...
LL | w!();
| ---- in this macro invocation
|
= note: this error originates in the macro `w` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider using `let _ =` and removing the call to `.ok()` instead
|
LL - Ok::<(), ()>(()).ok();
LL + let _ = Ok::<(), ()>(());
|
error: aborting due to 4 previous errors
|