@@ -4,41 +4,109 @@ error: called `ok().expect()` on a `Result` value
44LL | res.ok().expect("disaster!");
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
7- = help: you can call `expect()` directly on the `Result`
87 = note: `-D clippy::ok-expect` implied by `-D warnings`
98 = help: to override `-D warnings` add `#[allow(clippy::ok_expect)]`
9+ help: call `expect()` directly on the `Result`
10+ |
11+ LL - res.ok().expect("disaster!");
12+ LL + res.expect("disaster!");
13+ |
14+
15+ error: called `ok().expect()` on a `Result` value
16+ --> tests/ui/ok_expect.rs:19:5
17+ |
18+ LL | / res.ok()
19+ LL | | .expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
20+ | |___________________________________________________________________________^
21+ |
22+ help: call `expect()` directly on the `Result`
23+ |
24+ LL - res.ok()
25+ LL - .expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
26+ LL + res.expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
27+ |
1028
1129error: called `ok().expect()` on a `Result` value
1230 --> tests/ui/ok_expect.rs:24:5
1331 |
32+ LL | / resres
33+ LL | | .ok()
34+ LL | | .expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
35+ | |___________________________________________________________________________^
36+ |
37+ help: call `expect()` directly on the `Result`
38+ |
39+ LL - resres
40+ LL - .ok()
41+ LL - .expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
42+ LL + resres.expect("longlonglonglonglonglonglonglonglonglonglonglonglonglong");
43+ |
44+
45+ error: called `ok().expect()` on a `Result` value
46+ --> tests/ui/ok_expect.rs:30:5
47+ |
48+ LL | / std::process::Command::new("rustc")
49+ LL | | .arg("-vV")
50+ LL | | .output()
51+ LL | | .ok()
52+ LL | | .expect("failed to get rustc version");
53+ | |______________________________________________^
54+ |
55+ help: call `expect()` directly on the `Result`
56+ |
57+ LL - .output()
58+ LL - .ok()
59+ LL - .expect("failed to get rustc version");
60+ LL + .output().expect("failed to get rustc version");
61+ |
62+
63+ error: called `ok().expect()` on a `Result` value
64+ --> tests/ui/ok_expect.rs:42:5
65+ |
1466LL | res3.ok().expect("whoof");
1567 | ^^^^^^^^^^^^^^^^^^^^^^^^^
1668 |
17- = help: you can call `expect()` directly on the `Result`
69+ help: call `expect()` directly on the `Result`
70+ |
71+ LL - res3.ok().expect("whoof");
72+ LL + res3.expect("whoof");
73+ |
1874
1975error: called `ok().expect()` on a `Result` value
20- --> tests/ui/ok_expect.rs:28 :5
76+ --> tests/ui/ok_expect.rs:46 :5
2177 |
2278LL | res4.ok().expect("argh");
2379 | ^^^^^^^^^^^^^^^^^^^^^^^^
2480 |
25- = help: you can call `expect()` directly on the `Result`
81+ help: call `expect()` directly on the `Result`
82+ |
83+ LL - res4.ok().expect("argh");
84+ LL + res4.expect("argh");
85+ |
2686
2787error: called `ok().expect()` on a `Result` value
28- --> tests/ui/ok_expect.rs:32 :5
88+ --> tests/ui/ok_expect.rs:50 :5
2989 |
3090LL | res5.ok().expect("oops");
3191 | ^^^^^^^^^^^^^^^^^^^^^^^^
3292 |
33- = help: you can call `expect()` directly on the `Result`
93+ help: call `expect()` directly on the `Result`
94+ |
95+ LL - res5.ok().expect("oops");
96+ LL + res5.expect("oops");
97+ |
3498
3599error: called `ok().expect()` on a `Result` value
36- --> tests/ui/ok_expect.rs:36 :5
100+ --> tests/ui/ok_expect.rs:54 :5
37101 |
38102LL | res6.ok().expect("meh");
39103 | ^^^^^^^^^^^^^^^^^^^^^^^
40104 |
41- = help: you can call `expect()` directly on the `Result`
105+ help: call `expect()` directly on the `Result`
106+ |
107+ LL - res6.ok().expect("meh");
108+ LL + res6.expect("meh");
109+ |
42110
43- error: aborting due to 5 previous errors
111+ error: aborting due to 8 previous errors
44112
0 commit comments