mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Removing if so it's more like the previous implementation.
This commit is contained in:
parent
328abfb943
commit
425a70a460
@ -49,9 +49,7 @@ impl<'a> Iterator for Chars<'a> {
|
|||||||
// length in `char` is equal to the number of non-continuation bytes
|
// length in `char` is equal to the number of non-continuation bytes
|
||||||
let mut char_count = 0;
|
let mut char_count = 0;
|
||||||
for &byte in self.iter {
|
for &byte in self.iter {
|
||||||
if !utf8_is_cont_byte(byte) {
|
char_count += !utf8_is_cont_byte(byte) as usize;
|
||||||
char_count += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
char_count
|
char_count
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user