]> git.lizzy.rs Git - rust.git/blob - tests/ui/collapsible_match.stderr
Fix clippy let expressions fallout
[rust.git] / tests / ui / collapsible_match.stderr
1 error: this `match` can be collapsed into the outer `match`
2   --> $DIR/collapsible_match.rs:7:20
3    |
4 LL |           Ok(val) => match val {
5    |  ____________________^
6 LL | |             Some(n) => foo(n),
7 LL | |             _ => return,
8 LL | |         },
9    | |_________^
10    |
11    = note: `-D clippy::collapsible-match` implied by `-D warnings`
12 help: the outer pattern can be modified to include the inner pattern
13   --> $DIR/collapsible_match.rs:7:12
14    |
15 LL |         Ok(val) => match val {
16    |            ^^^ replace this binding
17 LL |             Some(n) => foo(n),
18    |             ^^^^^^^ with this pattern
19
20 error: this `match` can be collapsed into the outer `match`
21   --> $DIR/collapsible_match.rs:16:20
22    |
23 LL |           Ok(val) => match val {
24    |  ____________________^
25 LL | |             Some(n) => foo(n),
26 LL | |             _ => return,
27 LL | |         },
28    | |_________^
29    |
30 help: the outer pattern can be modified to include the inner pattern
31   --> $DIR/collapsible_match.rs:16:12
32    |
33 LL |         Ok(val) => match val {
34    |            ^^^ replace this binding
35 LL |             Some(n) => foo(n),
36    |             ^^^^^^^ with this pattern
37
38 error: this `if let` can be collapsed into the outer `if let`
39   --> $DIR/collapsible_match.rs:25:9
40    |
41 LL | /         if let Some(n) = val {
42 LL | |             take(n);
43 LL | |         }
44    | |_________^
45    |
46 help: the outer pattern can be modified to include the inner pattern
47   --> $DIR/collapsible_match.rs:24:15
48    |
49 LL |     if let Ok(val) = res_opt {
50    |               ^^^ replace this binding
51 LL |         if let Some(n) = val {
52    |                ^^^^^^^ with this pattern
53
54 error: this `if let` can be collapsed into the outer `if let`
55   --> $DIR/collapsible_match.rs:32:9
56    |
57 LL | /         if let Some(n) = val {
58 LL | |             take(n);
59 LL | |         } else {
60 LL | |             return;
61 LL | |         }
62    | |_________^
63    |
64 help: the outer pattern can be modified to include the inner pattern
65   --> $DIR/collapsible_match.rs:31:15
66    |
67 LL |     if let Ok(val) = res_opt {
68    |               ^^^ replace this binding
69 LL |         if let Some(n) = val {
70    |                ^^^^^^^ with this pattern
71
72 error: this `match` can be collapsed into the outer `if let`
73   --> $DIR/collapsible_match.rs:43:9
74    |
75 LL | /         match val {
76 LL | |             Some(n) => foo(n),
77 LL | |             _ => (),
78 LL | |         }
79    | |_________^
80    |
81 help: the outer pattern can be modified to include the inner pattern
82   --> $DIR/collapsible_match.rs:42:15
83    |
84 LL |     if let Ok(val) = res_opt {
85    |               ^^^ replace this binding
86 LL |         match val {
87 LL |             Some(n) => foo(n),
88    |             ^^^^^^^ with this pattern
89
90 error: this `if let` can be collapsed into the outer `match`
91   --> $DIR/collapsible_match.rs:52:13
92    |
93 LL | /             if let Some(n) = val {
94 LL | |                 take(n);
95 LL | |             }
96    | |_____________^
97    |
98 help: the outer pattern can be modified to include the inner pattern
99   --> $DIR/collapsible_match.rs:51:12
100    |
101 LL |         Ok(val) => {
102    |            ^^^ replace this binding
103 LL |             if let Some(n) = val {
104    |                    ^^^^^^^ with this pattern
105
106 error: this `match` can be collapsed into the outer `if let`
107   --> $DIR/collapsible_match.rs:61:9
108    |
109 LL | /         match val {
110 LL | |             Some(n) => foo(n),
111 LL | |             _ => return,
112 LL | |         }
113    | |_________^
114    |
115 help: the outer pattern can be modified to include the inner pattern
116   --> $DIR/collapsible_match.rs:60:15
117    |
118 LL |     if let Ok(val) = res_opt {
119    |               ^^^ replace this binding
120 LL |         match val {
121 LL |             Some(n) => foo(n),
122    |             ^^^^^^^ with this pattern
123
124 error: this `if let` can be collapsed into the outer `match`
125   --> $DIR/collapsible_match.rs:72:13
126    |
127 LL | /             if let Some(n) = val {
128 LL | |                 take(n);
129 LL | |             } else {
130 LL | |                 return;
131 LL | |             }
132    | |_____________^
133    |
134 help: the outer pattern can be modified to include the inner pattern
135   --> $DIR/collapsible_match.rs:71:12
136    |
137 LL |         Ok(val) => {
138    |            ^^^ replace this binding
139 LL |             if let Some(n) = val {
140    |                    ^^^^^^^ with this pattern
141
142 error: this `match` can be collapsed into the outer `match`
143   --> $DIR/collapsible_match.rs:83:20
144    |
145 LL |           Ok(val) => match val {
146    |  ____________________^
147 LL | |             Some(n) => foo(n),
148 LL | |             None => return,
149 LL | |         },
150    | |_________^
151    |
152 help: the outer pattern can be modified to include the inner pattern
153   --> $DIR/collapsible_match.rs:83:12
154    |
155 LL |         Ok(val) => match val {
156    |            ^^^ replace this binding
157 LL |             Some(n) => foo(n),
158    |             ^^^^^^^ with this pattern
159
160 error: this `match` can be collapsed into the outer `match`
161   --> $DIR/collapsible_match.rs:92:22
162    |
163 LL |           Some(val) => match val {
164    |  ______________________^
165 LL | |             Some(n) => foo(n),
166 LL | |             _ => return,
167 LL | |         },
168    | |_________^
169    |
170 help: the outer pattern can be modified to include the inner pattern
171   --> $DIR/collapsible_match.rs:92:14
172    |
173 LL |         Some(val) => match val {
174    |              ^^^ replace this binding
175 LL |             Some(n) => foo(n),
176    |             ^^^^^^^ with this pattern
177
178 error: aborting due to 10 previous errors
179