blob: d319e65d06ce8ade969aebbd57d3e1232d85f537 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
error: this binding can be a slice pattern to avoid indexing
--> $DIR/index_refutable_slice.rs:5:17
|
LL | if let Some(slice) = slice {
| ^^^^^
|
note: the lint level is defined here
--> $DIR/index_refutable_slice.rs:1:9
|
LL | #![deny(clippy::index_refutable_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using a slice pattern here
|
LL | if let Some([_, _, _, _, _, _, _, slice_7, ..]) = slice {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: and replace the index expressions here
|
LL | println!("{}", slice_7);
| ~~~~~~~
error: aborting due to previous error
|