|
1 | | -error: question mark operator is useless here |
| 1 | +error: enclosing `Some` and `?` operator are unneeded |
2 | 2 | --> tests/ui/needless_question_mark.rs:20:12 |
3 | 3 | | |
4 | 4 | LL | return Some(to.magic?); |
5 | | - | ^^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `to.magic` |
| 5 | + | ^^^^^^^^^^^^^^^ |
6 | 6 | | |
7 | 7 | = note: `-D clippy::needless-question-mark` implied by `-D warnings` |
8 | 8 | = help: to override `-D warnings` add `#[allow(clippy::needless_question_mark)]` |
| 9 | +help: remove the enclosing `Some` and `?` operator |
| 10 | + | |
| 11 | +LL - return Some(to.magic?); |
| 12 | +LL + return to.magic; |
| 13 | + | |
9 | 14 |
|
10 | | -error: question mark operator is useless here |
| 15 | +error: enclosing `Some` and `?` operator are unneeded |
11 | 16 | --> tests/ui/needless_question_mark.rs:29:12 |
12 | 17 | | |
13 | 18 | LL | return Some(to.magic?) |
14 | | - | ^^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `to.magic` |
| 19 | + | ^^^^^^^^^^^^^^^ |
| 20 | + | |
| 21 | +help: remove the enclosing `Some` and `?` operator |
| 22 | + | |
| 23 | +LL - return Some(to.magic?) |
| 24 | +LL + return to.magic |
| 25 | + | |
15 | 26 |
|
16 | | -error: question mark operator is useless here |
| 27 | +error: enclosing `Some` and `?` operator are unneeded |
17 | 28 | --> tests/ui/needless_question_mark.rs:35:5 |
18 | 29 | | |
19 | 30 | LL | Some(to.magic?) |
20 | | - | ^^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `to.magic` |
| 31 | + | ^^^^^^^^^^^^^^^ |
| 32 | + | |
| 33 | +help: remove the enclosing `Some` and `?` operator |
| 34 | + | |
| 35 | +LL - Some(to.magic?) |
| 36 | +LL + to.magic |
| 37 | + | |
21 | 38 |
|
22 | | -error: question mark operator is useless here |
| 39 | +error: enclosing `Some` and `?` operator are unneeded |
23 | 40 | --> tests/ui/needless_question_mark.rs:41:21 |
24 | 41 | | |
25 | 42 | LL | to.and_then(|t| Some(t.magic?)) |
26 | | - | ^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `t.magic` |
| 43 | + | ^^^^^^^^^^^^^^ |
| 44 | + | |
| 45 | +help: remove the enclosing `Some` and `?` operator |
| 46 | + | |
| 47 | +LL - to.and_then(|t| Some(t.magic?)) |
| 48 | +LL + to.and_then(|t| t.magic) |
| 49 | + | |
27 | 50 |
|
28 | | -error: question mark operator is useless here |
| 51 | +error: enclosing `Some` and `?` operator are unneeded |
29 | 52 | --> tests/ui/needless_question_mark.rs:51:9 |
30 | 53 | | |
31 | 54 | LL | Some(t.magic?) |
32 | | - | ^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `t.magic` |
| 55 | + | ^^^^^^^^^^^^^^ |
| 56 | + | |
| 57 | +help: remove the enclosing `Some` and `?` operator |
| 58 | + | |
| 59 | +LL - Some(t.magic?) |
| 60 | +LL + t.magic |
| 61 | + | |
33 | 62 |
|
34 | | -error: question mark operator is useless here |
| 63 | +error: enclosing `Ok` and `?` operator are unneeded |
35 | 64 | --> tests/ui/needless_question_mark.rs:57:12 |
36 | 65 | | |
37 | 66 | LL | return Ok(tr.magic?); |
38 | | - | ^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `tr.magic` |
| 67 | + | ^^^^^^^^^^^^^ |
| 68 | + | |
| 69 | +help: remove the enclosing `Ok` and `?` operator |
| 70 | + | |
| 71 | +LL - return Ok(tr.magic?); |
| 72 | +LL + return tr.magic; |
| 73 | + | |
39 | 74 |
|
40 | | -error: question mark operator is useless here |
| 75 | +error: enclosing `Ok` and `?` operator are unneeded |
41 | 76 | --> tests/ui/needless_question_mark.rs:65:12 |
42 | 77 | | |
43 | 78 | LL | return Ok(tr.magic?) |
44 | | - | ^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `tr.magic` |
| 79 | + | ^^^^^^^^^^^^^ |
| 80 | + | |
| 81 | +help: remove the enclosing `Ok` and `?` operator |
| 82 | + | |
| 83 | +LL - return Ok(tr.magic?) |
| 84 | +LL + return tr.magic |
| 85 | + | |
45 | 86 |
|
46 | | -error: question mark operator is useless here |
| 87 | +error: enclosing `Ok` and `?` operator are unneeded |
47 | 88 | --> tests/ui/needless_question_mark.rs:70:5 |
48 | 89 | | |
49 | 90 | LL | Ok(tr.magic?) |
50 | | - | ^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `tr.magic` |
| 91 | + | ^^^^^^^^^^^^^ |
| 92 | + | |
| 93 | +help: remove the enclosing `Ok` and `?` operator |
| 94 | + | |
| 95 | +LL - Ok(tr.magic?) |
| 96 | +LL + tr.magic |
| 97 | + | |
51 | 98 |
|
52 | | -error: question mark operator is useless here |
| 99 | +error: enclosing `Ok` and `?` operator are unneeded |
53 | 100 | --> tests/ui/needless_question_mark.rs:75:21 |
54 | 101 | | |
55 | 102 | LL | tr.and_then(|t| Ok(t.magic?)) |
56 | | - | ^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `t.magic` |
| 103 | + | ^^^^^^^^^^^^ |
| 104 | + | |
| 105 | +help: remove the enclosing `Ok` and `?` operator |
| 106 | + | |
| 107 | +LL - tr.and_then(|t| Ok(t.magic?)) |
| 108 | +LL + tr.and_then(|t| t.magic) |
| 109 | + | |
57 | 110 |
|
58 | | -error: question mark operator is useless here |
| 111 | +error: enclosing `Ok` and `?` operator are unneeded |
59 | 112 | --> tests/ui/needless_question_mark.rs:84:9 |
60 | 113 | | |
61 | 114 | LL | Ok(t.magic?) |
62 | | - | ^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `t.magic` |
| 115 | + | ^^^^^^^^^^^^ |
| 116 | + | |
| 117 | +help: remove the enclosing `Ok` and `?` operator |
| 118 | + | |
| 119 | +LL - Ok(t.magic?) |
| 120 | +LL + t.magic |
| 121 | + | |
63 | 122 |
|
64 | | -error: question mark operator is useless here |
| 123 | +error: enclosing `Ok` and `?` operator are unneeded |
65 | 124 | --> tests/ui/needless_question_mark.rs:92:16 |
66 | 125 | | |
67 | 126 | LL | return Ok(t.magic?); |
68 | | - | ^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `t.magic` |
| 127 | + | ^^^^^^^^^^^^ |
| 128 | + | |
| 129 | +help: remove the enclosing `Ok` and `?` operator |
| 130 | + | |
| 131 | +LL - return Ok(t.magic?); |
| 132 | +LL + return t.magic; |
| 133 | + | |
69 | 134 |
|
70 | | -error: question mark operator is useless here |
| 135 | +error: enclosing `Some` and `?` operator are unneeded |
71 | 136 | --> tests/ui/needless_question_mark.rs:128:27 |
72 | 137 | | |
73 | 138 | LL | || -> Option<_> { Some(Some($expr)?) }() |
74 | | - | ^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `Some($expr)` |
| 139 | + | ^^^^^^^^^^^^^^^^^^ |
75 | 140 | ... |
76 | 141 | LL | let _x = some_and_qmark_in_macro!(x?); |
77 | 142 | | ---------------------------- in this macro invocation |
78 | 143 | | |
79 | 144 | = note: this error originates in the macro `some_and_qmark_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 145 | +help: remove the enclosing `Some` and `?` operator |
| 146 | + | |
| 147 | +LL - || -> Option<_> { Some(Some($expr)?) }() |
| 148 | +LL + || -> Option<_> { Some($expr) }() |
| 149 | + | |
80 | 150 |
|
81 | | -error: question mark operator is useless here |
| 151 | +error: enclosing `Some` and `?` operator are unneeded |
82 | 152 | --> tests/ui/needless_question_mark.rs:140:5 |
83 | 153 | | |
84 | 154 | LL | Some(to.magic?) |
85 | | - | ^^^^^^^^^^^^^^^ help: try removing question mark and `Some()`: `to.magic` |
| 155 | + | ^^^^^^^^^^^^^^^ |
| 156 | + | |
| 157 | +help: remove the enclosing `Some` and `?` operator |
| 158 | + | |
| 159 | +LL - Some(to.magic?) |
| 160 | +LL + to.magic |
| 161 | + | |
86 | 162 |
|
87 | | -error: question mark operator is useless here |
| 163 | +error: enclosing `Ok` and `?` operator are unneeded |
88 | 164 | --> tests/ui/needless_question_mark.rs:149:5 |
89 | 165 | | |
90 | 166 | LL | Ok(s.magic?) |
91 | | - | ^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `s.magic` |
| 167 | + | ^^^^^^^^^^^^ |
| 168 | + | |
| 169 | +help: remove the enclosing `Ok` and `?` operator |
| 170 | + | |
| 171 | +LL - Ok(s.magic?) |
| 172 | +LL + s.magic |
| 173 | + | |
92 | 174 |
|
93 | | -error: question mark operator is useless here |
| 175 | +error: enclosing `Some` and `?` operator are unneeded |
94 | 176 | --> tests/ui/needless_question_mark.rs:154:7 |
95 | 177 | | |
96 | 178 | LL | { Some(a?) } |
97 | | - | ^^^^^^^^ help: try removing question mark and `Some()`: `a` |
| 179 | + | ^^^^^^^^ |
| 180 | + | |
| 181 | +help: remove the enclosing `Some` and `?` operator |
| 182 | + | |
| 183 | +LL - { Some(a?) } |
| 184 | +LL + { a } |
| 185 | + | |
98 | 186 |
|
99 | 187 | error: aborting due to 15 previous errors |
100 | 188 |
|
0 commit comments