1
- error: this slice can be deconstructured to avoid indexing
1
+ error: this binding can be a slice pattern to avoid indexing
2
2
--> $DIR/if_let_slice_destruction.rs:13:17
3
3
|
4
4
LL | if let Some(slice) = slice {
@@ -9,7 +9,7 @@ note: the lint level is defined here
9
9
|
10
10
LL | #![deny(clippy::avoidable_slice_indexing)]
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
- help: try destructing the slice with a pattern here
12
+ help: try using a slice pattern here
13
13
|
14
14
LL | if let Some([slice_0, ..]) = slice {
15
15
| ~~~~~~~~~~~~~
@@ -18,13 +18,13 @@ help: and replacing the index expressions here
18
18
LL | println!("{}", slice_0);
19
19
| ~~~~~~~
20
20
21
- error: this slice can be deconstructured to avoid indexing
21
+ error: this binding can be a slice pattern to avoid indexing
22
22
--> $DIR/if_let_slice_destruction.rs:19:17
23
23
|
24
24
LL | if let Some(slice) = slice {
25
25
| ^^^^^
26
26
|
27
- help: try destructing the slice with a pattern here
27
+ help: try using a slice pattern here
28
28
|
29
29
LL | if let Some([ref slice_0, ..]) = slice {
30
30
| ~~~~~~~~~~~~~~~~~
@@ -33,13 +33,13 @@ help: and replacing the index expressions here
33
33
LL | println!("{}", slice_0);
34
34
| ~~~~~~~
35
35
36
- error: this slice can be deconstructured to avoid indexing
36
+ error: this binding can be a slice pattern to avoid indexing
37
37
--> $DIR/if_let_slice_destruction.rs:25:17
38
38
|
39
39
LL | if let Some(slice) = slice {
40
40
| ^^^^^
41
41
|
42
- help: try destructing the slice with a pattern here
42
+ help: try using a slice pattern here
43
43
|
44
44
LL | if let Some([ref slice_0, _, ref slice_2, ..]) = slice {
45
45
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -49,13 +49,13 @@ LL ~ println!("{}", slice_2);
49
49
LL ~ println!("{}", slice_0);
50
50
|
51
51
52
- error: this slice can be deconstructured to avoid indexing
52
+ error: this binding can be a slice pattern to avoid indexing
53
53
--> $DIR/if_let_slice_destruction.rs:32:26
54
54
|
55
55
LL | if let SomeEnum::One(slice) | SomeEnum::Three(slice) = slice_wrapped {
56
56
| ^^^^^
57
57
|
58
- help: try destructing the slice with a pattern here
58
+ help: try using a slice pattern here
59
59
|
60
60
LL | if let SomeEnum::One([ref slice_0, ..]) | SomeEnum::Three([ref slice_0, ..]) = slice_wrapped {
61
61
| ~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
@@ -64,13 +64,13 @@ help: and replacing the index expressions here
64
64
LL | println!("{}", slice_0);
65
65
| ~~~~~~~
66
66
67
- error: this slice can be deconstructured to avoid indexing
67
+ error: this binding can be a slice pattern to avoid indexing
68
68
--> $DIR/if_let_slice_destruction.rs:39:29
69
69
|
70
70
LL | if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) {
71
71
| ^
72
72
|
73
- help: try destructing the slice with a pattern here
73
+ help: try using a slice pattern here
74
74
|
75
75
LL | if let (SomeEnum::Three([_, _, ref a_2, ..]), Some(b)) = (a_wrapped, b_wrapped) {
76
76
| ~~~~~~~~~~~~~~~~~~~
@@ -79,13 +79,13 @@ help: and replacing the index expressions here
79
79
LL | println!("{} -> {}", a_2, b[1]);
80
80
| ~~~
81
81
82
- error: this slice can be deconstructured to avoid indexing
82
+ error: this binding can be a slice pattern to avoid indexing
83
83
--> $DIR/if_let_slice_destruction.rs:39:38
84
84
|
85
85
LL | if let (SomeEnum::Three(a), Some(b)) = (a_wrapped, b_wrapped) {
86
86
| ^
87
87
|
88
- help: try destructing the slice with a pattern here
88
+ help: try using a slice pattern here
89
89
|
90
90
LL | if let (SomeEnum::Three(a), Some([_, ref b_1, ..])) = (a_wrapped, b_wrapped) {
91
91
| ~~~~~~~~~~~~~~~~
@@ -94,13 +94,13 @@ help: and replacing the index expressions here
94
94
LL | println!("{} -> {}", a[2], b_1);
95
95
| ~~~
96
96
97
- error: this slice can be deconstructured to avoid indexing
97
+ error: this binding can be a slice pattern to avoid indexing
98
98
--> $DIR/if_let_slice_destruction.rs:46:21
99
99
|
100
100
LL | if let Some(ref slice) = slice {
101
101
| ^^^^^
102
102
|
103
- help: try destructing the slice with a pattern here
103
+ help: try using a slice pattern here
104
104
|
105
105
LL | if let Some([_, ref slice_1, ..]) = slice {
106
106
| ~~~~~~~~~~~~~~~~~~~~
@@ -109,13 +109,13 @@ help: and replacing the index expressions here
109
109
LL | println!("{:?}", slice_1);
110
110
| ~~~~~~~
111
111
112
- error: this slice can be deconstructured to avoid indexing
112
+ error: this binding can be a slice pattern to avoid indexing
113
113
--> $DIR/if_let_slice_destruction.rs:54:17
114
114
|
115
115
LL | if let Some(slice) = &slice {
116
116
| ^^^^^
117
117
|
118
- help: try destructing the slice with a pattern here
118
+ help: try using a slice pattern here
119
119
|
120
120
LL | if let Some([ref slice_0, ..]) = &slice {
121
121
| ~~~~~~~~~~~~~~~~~
@@ -124,13 +124,13 @@ help: and replacing the index expressions here
124
124
LL | println!("{:?}", slice_0);
125
125
| ~~~~~~~
126
126
127
- error: this slice can be deconstructured to avoid indexing
127
+ error: this binding can be a slice pattern to avoid indexing
128
128
--> $DIR/if_let_slice_destruction.rs:123:17
129
129
|
130
130
LL | if let Some(slice) = wrap.inner {
131
131
| ^^^^^
132
132
|
133
- help: try destructing the slice with a pattern here
133
+ help: try using a slice pattern here
134
134
|
135
135
LL | if let Some([ref slice_0, ..]) = wrap.inner {
136
136
| ~~~~~~~~~~~~~~~~~
@@ -139,13 +139,13 @@ help: and replacing the index expressions here
139
139
LL | println!("This is awesome! {}", slice_0);
140
140
| ~~~~~~~
141
141
142
- error: this slice can be deconstructured to avoid indexing
142
+ error: this binding can be a slice pattern to avoid indexing
143
143
--> $DIR/if_let_slice_destruction.rs:130:17
144
144
|
145
145
LL | if let Some(slice) = wrap.inner {
146
146
| ^^^^^
147
147
|
148
- help: try destructing the slice with a pattern here
148
+ help: try using a slice pattern here
149
149
|
150
150
LL | if let Some([ref slice_0, ..]) = wrap.inner {
151
151
| ~~~~~~~~~~~~~~~~~
0 commit comments