@@ -14,8 +14,9 @@ LL | for (idx, _) in prim.chars().enumerate() {
14
14
= help: to override `-D warnings` add `#[allow(clippy::char_indices_as_byte_indices)]`
15
15
help: consider using `.char_indices()` instead
16
16
|
17
- LL | for (idx, _) in prim.char_indices() {
18
- | ~~~~~~~~~~~~~~
17
+ LL - for (idx, _) in prim.chars().enumerate() {
18
+ LL + for (idx, _) in prim.char_indices() {
19
+ |
19
20
20
21
error: passing a character position to a method that expects a byte index
21
22
--> tests/ui/char_indices_as_byte_indices.rs:15:23
@@ -31,8 +32,9 @@ LL | for (idx, _) in prim.chars().enumerate() {
31
32
| ^^^ ^^^^^^^^^^^
32
33
help: consider using `.char_indices()` instead
33
34
|
34
- LL | for (idx, _) in prim.char_indices() {
35
- | ~~~~~~~~~~~~~~
35
+ LL - for (idx, _) in prim.chars().enumerate() {
36
+ LL + for (idx, _) in prim.char_indices() {
37
+ |
36
38
37
39
error: passing a character position to a method that expects a byte index
38
40
--> tests/ui/char_indices_as_byte_indices.rs:19:49
@@ -48,8 +50,9 @@ LL | for (idx, _) in prim.chars().enumerate() {
48
50
| ^^^ ^^^^^^^^^^^
49
51
help: consider using `.char_indices()` instead
50
52
|
51
- LL | for (idx, _) in prim.char_indices() {
52
- | ~~~~~~~~~~~~~~
53
+ LL - for (idx, _) in prim.chars().enumerate() {
54
+ LL + for (idx, _) in prim.char_indices() {
55
+ |
53
56
54
57
error: indexing into a string with a character position where a byte index is expected
55
58
--> tests/ui/char_indices_as_byte_indices.rs:29:24
@@ -65,8 +68,9 @@ LL | for c in prim.chars().enumerate() {
65
68
| ^ ^^^^^^^^^^^
66
69
help: consider using `.char_indices()` instead
67
70
|
68
- LL | for c in prim.char_indices() {
69
- | ~~~~~~~~~~~~~~
71
+ LL - for c in prim.chars().enumerate() {
72
+ LL + for c in prim.char_indices() {
73
+ |
70
74
71
75
error: passing a character position to a method that expects a byte index
72
76
--> tests/ui/char_indices_as_byte_indices.rs:31:23
@@ -82,8 +86,9 @@ LL | for c in prim.chars().enumerate() {
82
86
| ^ ^^^^^^^^^^^
83
87
help: consider using `.char_indices()` instead
84
88
|
85
- LL | for c in prim.char_indices() {
86
- | ~~~~~~~~~~~~~~
89
+ LL - for c in prim.chars().enumerate() {
90
+ LL + for c in prim.char_indices() {
91
+ |
87
92
88
93
error: indexing into a string with a character position where a byte index is expected
89
94
--> tests/ui/char_indices_as_byte_indices.rs:36:26
@@ -99,8 +104,9 @@ LL | for (idx, _) in string.chars().enumerate() {
99
104
| ^^^ ^^^^^^^^^^^
100
105
help: consider using `.char_indices()` instead
101
106
|
102
- LL | for (idx, _) in string.char_indices() {
103
- | ~~~~~~~~~~~~~~
107
+ LL - for (idx, _) in string.chars().enumerate() {
108
+ LL + for (idx, _) in string.char_indices() {
109
+ |
104
110
105
111
error: passing a character position to a method that expects a byte index
106
112
--> tests/ui/char_indices_as_byte_indices.rs:38:25
@@ -116,8 +122,9 @@ LL | for (idx, _) in string.chars().enumerate() {
116
122
| ^^^ ^^^^^^^^^^^
117
123
help: consider using `.char_indices()` instead
118
124
|
119
- LL | for (idx, _) in string.char_indices() {
120
- | ~~~~~~~~~~~~~~
125
+ LL - for (idx, _) in string.chars().enumerate() {
126
+ LL + for (idx, _) in string.char_indices() {
127
+ |
121
128
122
129
error: aborting due to 7 previous errors
123
130
0 commit comments