Removing if so it's more like the previous implementation.

This commit is contained in:
Giles Cope 2021-01-26 11:26:58 +00:00
parent 328abfb943
commit 425a70a460
No known key found for this signature in database
GPG Key ID: DF85161DAE0FF36B

View File

@ -49,9 +49,7 @@ impl<'a> Iterator for Chars<'a> {
// length in `char` is equal to the number of non-continuation bytes
let mut char_count = 0;
for &byte in self.iter {
if !utf8_is_cont_byte(byte) {
char_count += 1;
}
char_count += !utf8_is_cont_byte(byte) as usize;
}
char_count
}