-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Expand file tree
/
Copy pathcollapsible_match_fixable.stderr
More file actions
137 lines (127 loc) · 3.5 KB
/
Copy pathcollapsible_match_fixable.stderr
File metadata and controls
137 lines (127 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:8:13
|
LL | if s == 1 { s } else { 1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::collapsible-match` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_match)]`
help: collapse nested if block
|
LL ~ Some(s)
LL ~ if s == 1 => { s }
LL |
LL ~ ,
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:16:13
|
LL | / (if s == 1 {
LL | |
LL | | todo!()
LL | | })
| |______________^
|
help: collapse nested if block
|
LL ~ Some(s)
LL ~ if s == 1 => {
LL |
LL | todo!()
LL ~ },
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:26:13
|
LL | if s == 1 { s } else { 1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: collapse nested if block
|
LL ~ Some(s) if s > 2
LL ~ && s == 1 => { s }
LL |
LL ~ ,
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:39:13
|
LL | / if b == 0 {
LL | |
LL | | res = 1;
LL | | }
| |_____________^
|
help: collapse nested if block
|
LL ~ Some(_)
LL ~ if b == 0 => {
LL |
LL | res = 1;
LL ~ },
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:52:18
|
LL | 0 | 1 => if false { println!("hello world"); },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: collapse nested if block
|
LL - 0 | 1 => if false { println!("hello world"); },
LL + 0 | 1 if false => { println!("hello world"); },
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:59:20
|
LL | Some(s) => if s == 1 { s } else { 1 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: collapse nested if block
|
LL - Some(s) => if s == 1 { s } else { 1 }
LL + Some(s) if s == 1 => { s }
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:71:15
|
LL | 13 => if a > b { 1 } else { 0 }, _ => 0,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: collapse nested if block
|
LL - 13 => if a > b { 1 } else { 0 }, _ => 0,
LL + 13 if a > b => { 1 }, _ => 0,
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:76:24
|
LL | 11 => 0, 12 => if a == b { 1 } else { 0 }, _ => 0,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: collapse nested if block
|
LL - 11 => 0, 12 => if a == b { 1 } else { 0 }, _ => 0,
LL + 11 => 0, 12 if a == b => { 1 }, _ => 0,
|
error: this `if` can be collapsed into the outer `match`
--> tests/ui/collapsible_match_fixable.rs:88:13
|
LL | / if true {
LL | |
LL | | let Some(_y) = Some(0) else {
LL | | break 'label;
LL | | };
LL | | }
| |_____________^
|
help: collapse nested if block
|
LL ~ Ok(Some(_c))
LL ~ if true => 'label: {
LL |
...
LL | };
LL ~ },
|
error: aborting due to 9 previous errors