11error: this block may be rewritten with the `?` operator
2- --> $DIR/question_mark.rs:9 :5
2+ --> $DIR/question_mark.rs:6 :5
33 |
44LL | / if a.is_none() {
55LL | | return None;
@@ -9,23 +9,23 @@ LL | | }
99 = note: `-D clippy::question-mark` implied by `-D warnings`
1010
1111error: this block may be rewritten with the `?` operator
12- --> $DIR/question_mark.rs:54 :9
12+ --> $DIR/question_mark.rs:51 :9
1313 |
1414LL | / if (self.opt).is_none() {
1515LL | | return None;
1616LL | | }
1717 | |_________^ help: replace it with: `(self.opt)?;`
1818
1919error: this block may be rewritten with the `?` operator
20- --> $DIR/question_mark.rs:58 :9
20+ --> $DIR/question_mark.rs:55 :9
2121 |
2222LL | / if self.opt.is_none() {
2323LL | | return None
2424LL | | }
2525 | |_________^ help: replace it with: `self.opt?;`
2626
2727error: this block may be rewritten with the `?` operator
28- --> $DIR/question_mark.rs:62 :17
28+ --> $DIR/question_mark.rs:59 :17
2929 |
3030LL | let _ = if self.opt.is_none() {
3131 | _________________^
@@ -36,7 +36,7 @@ LL | | };
3636 | |_________^ help: replace it with: `Some(self.opt?)`
3737
3838error: this if-let-else may be rewritten with the `?` operator
39- --> $DIR/question_mark.rs:68 :17
39+ --> $DIR/question_mark.rs:65 :17
4040 |
4141LL | let _ = if let Some(x) = self.opt {
4242 | _________________^
@@ -47,31 +47,31 @@ LL | | };
4747 | |_________^ help: replace it with: `self.opt?`
4848
4949error: this block may be rewritten with the `?` operator
50- --> $DIR/question_mark.rs:85 :9
50+ --> $DIR/question_mark.rs:82 :9
5151 |
5252LL | / if self.opt.is_none() {
5353LL | | return None;
5454LL | | }
5555 | |_________^ help: replace it with: `self.opt.as_ref()?;`
5656
5757error: this block may be rewritten with the `?` operator
58- --> $DIR/question_mark.rs:93 :9
58+ --> $DIR/question_mark.rs:90 :9
5959 |
6060LL | / if self.opt.is_none() {
6161LL | | return None;
6262LL | | }
6363 | |_________^ help: replace it with: `self.opt.as_ref()?;`
6464
6565error: this block may be rewritten with the `?` operator
66- --> $DIR/question_mark.rs:101 :9
66+ --> $DIR/question_mark.rs:98 :9
6767 |
6868LL | / if self.opt.is_none() {
6969LL | | return None;
7070LL | | }
7171 | |_________^ help: replace it with: `self.opt.as_ref()?;`
7272
7373error: this if-let-else may be rewritten with the `?` operator
74- --> $DIR/question_mark.rs:108 :26
74+ --> $DIR/question_mark.rs:105 :26
7575 |
7676LL | let v: &Vec<_> = if let Some(ref v) = self.opt {
7777 | __________________________^
@@ -82,7 +82,7 @@ LL | | };
8282 | |_________^ help: replace it with: `self.opt.as_ref()?`
8383
8484error: this if-let-else may be rewritten with the `?` operator
85- --> $DIR/question_mark.rs:118 :17
85+ --> $DIR/question_mark.rs:115 :17
8686 |
8787LL | let v = if let Some(v) = self.opt {
8888 | _________________^
@@ -93,26 +93,26 @@ LL | | };
9393 | |_________^ help: replace it with: `self.opt?`
9494
9595error: this block may be rewritten with the `?` operator
96- --> $DIR/question_mark.rs:133 :5
96+ --> $DIR/question_mark.rs:130 :5
9797 |
9898LL | / if f().is_none() {
9999LL | | return None;
100100LL | | }
101101 | |_____^ help: replace it with: `f()?;`
102102
103103error: this if-let-else may be rewritten with the `?` operator
104- --> $DIR/question_mark.rs:145 :13
104+ --> $DIR/question_mark.rs:142 :13
105105 |
106106LL | let _ = if let Ok(x) = x { x } else { return x };
107107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x?`
108108
109109error: this block may be rewritten with the `?` operator
110- --> $DIR/question_mark.rs:147 :5
110+ --> $DIR/question_mark.rs:144 :5
111111 |
112112LL | / if x.is_err() {
113113LL | | return x;
114114LL | | }
115- | |_____^ help: replace it with: `x.as_ref() ?;`
115+ | |_____^ help: replace it with: `x?;`
116116
117117error: aborting due to 13 previous errors
118118
0 commit comments