1
1
error: this block may be rewritten with the `?` operator
2
- --> $DIR/question_mark.rs:9 :5
2
+ --> $DIR/question_mark.rs:6 :5
3
3
|
4
4
LL | / if a.is_none() {
5
5
LL | | return None;
@@ -9,23 +9,23 @@ LL | | }
9
9
= note: `-D clippy::question-mark` implied by `-D warnings`
10
10
11
11
error: this block may be rewritten with the `?` operator
12
- --> $DIR/question_mark.rs:54 :9
12
+ --> $DIR/question_mark.rs:51 :9
13
13
|
14
14
LL | / if (self.opt).is_none() {
15
15
LL | | return None;
16
16
LL | | }
17
17
| |_________^ help: replace it with: `(self.opt)?;`
18
18
19
19
error: this block may be rewritten with the `?` operator
20
- --> $DIR/question_mark.rs:58 :9
20
+ --> $DIR/question_mark.rs:55 :9
21
21
|
22
22
LL | / if self.opt.is_none() {
23
23
LL | | return None
24
24
LL | | }
25
25
| |_________^ help: replace it with: `self.opt?;`
26
26
27
27
error: this block may be rewritten with the `?` operator
28
- --> $DIR/question_mark.rs:62 :17
28
+ --> $DIR/question_mark.rs:59 :17
29
29
|
30
30
LL | let _ = if self.opt.is_none() {
31
31
| _________________^
@@ -36,7 +36,7 @@ LL | | };
36
36
| |_________^ help: replace it with: `Some(self.opt?)`
37
37
38
38
error: this if-let-else may be rewritten with the `?` operator
39
- --> $DIR/question_mark.rs:68 :17
39
+ --> $DIR/question_mark.rs:65 :17
40
40
|
41
41
LL | let _ = if let Some(x) = self.opt {
42
42
| _________________^
@@ -47,31 +47,31 @@ LL | | };
47
47
| |_________^ help: replace it with: `self.opt?`
48
48
49
49
error: this block may be rewritten with the `?` operator
50
- --> $DIR/question_mark.rs:85 :9
50
+ --> $DIR/question_mark.rs:82 :9
51
51
|
52
52
LL | / if self.opt.is_none() {
53
53
LL | | return None;
54
54
LL | | }
55
55
| |_________^ help: replace it with: `self.opt.as_ref()?;`
56
56
57
57
error: this block may be rewritten with the `?` operator
58
- --> $DIR/question_mark.rs:93 :9
58
+ --> $DIR/question_mark.rs:90 :9
59
59
|
60
60
LL | / if self.opt.is_none() {
61
61
LL | | return None;
62
62
LL | | }
63
63
| |_________^ help: replace it with: `self.opt.as_ref()?;`
64
64
65
65
error: this block may be rewritten with the `?` operator
66
- --> $DIR/question_mark.rs:101 :9
66
+ --> $DIR/question_mark.rs:98 :9
67
67
|
68
68
LL | / if self.opt.is_none() {
69
69
LL | | return None;
70
70
LL | | }
71
71
| |_________^ help: replace it with: `self.opt.as_ref()?;`
72
72
73
73
error: this if-let-else may be rewritten with the `?` operator
74
- --> $DIR/question_mark.rs:108 :26
74
+ --> $DIR/question_mark.rs:105 :26
75
75
|
76
76
LL | let v: &Vec<_> = if let Some(ref v) = self.opt {
77
77
| __________________________^
@@ -82,7 +82,7 @@ LL | | };
82
82
| |_________^ help: replace it with: `self.opt.as_ref()?`
83
83
84
84
error: this if-let-else may be rewritten with the `?` operator
85
- --> $DIR/question_mark.rs:118 :17
85
+ --> $DIR/question_mark.rs:115 :17
86
86
|
87
87
LL | let v = if let Some(v) = self.opt {
88
88
| _________________^
@@ -93,26 +93,26 @@ LL | | };
93
93
| |_________^ help: replace it with: `self.opt?`
94
94
95
95
error: this block may be rewritten with the `?` operator
96
- --> $DIR/question_mark.rs:133 :5
96
+ --> $DIR/question_mark.rs:130 :5
97
97
|
98
98
LL | / if f().is_none() {
99
99
LL | | return None;
100
100
LL | | }
101
101
| |_____^ help: replace it with: `f()?;`
102
102
103
103
error: this if-let-else may be rewritten with the `?` operator
104
- --> $DIR/question_mark.rs:145 :13
104
+ --> $DIR/question_mark.rs:142 :13
105
105
|
106
106
LL | let _ = if let Ok(x) = x { x } else { return x };
107
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x?`
108
108
109
109
error: this block may be rewritten with the `?` operator
110
- --> $DIR/question_mark.rs:147 :5
110
+ --> $DIR/question_mark.rs:144 :5
111
111
|
112
112
LL | / if x.is_err() {
113
113
LL | | return x;
114
114
LL | | }
115
- | |_____^ help: replace it with: `x.as_ref() ?;`
115
+ | |_____^ help: replace it with: `x?;`
116
116
117
117
error: aborting due to 13 previous errors
118
118
0 commit comments