We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca9a134 + 69cc5fa commit 6395398Copy full SHA for 6395398
1 file changed
library/core/src/str/lossy.rs
@@ -211,12 +211,7 @@ impl<'a> Iterator for Utf8Chunks<'a> {
211
212
let mut i = 0;
213
let mut valid_up_to = 0;
214
- while i < self.source.len() {
215
- // SAFETY: `i < self.source.len()` per previous line.
216
- // For some reason the following are both significantly slower:
217
- // while let Some(&byte) = self.source.get(i) {
218
- // while let Some(byte) = self.source.get(i).copied() {
219
- let byte = unsafe { *self.source.get_unchecked(i) };
+ while let Some(byte) = self.source.get(i).copied() {
220
i += 1;
221
222
if byte < 128 {
0 commit comments