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.
1 parent 328abfb commit 425a70aCopy full SHA for 425a70a
library/core/src/str/iter.rs
@@ -49,9 +49,7 @@ impl<'a> Iterator for Chars<'a> {
49
// length in `char` is equal to the number of non-continuation bytes
50
let mut char_count = 0;
51
for &byte in self.iter {
52
- if !utf8_is_cont_byte(byte) {
53
- char_count += 1;
54
- }
+ char_count += !utf8_is_cont_byte(byte) as usize;
55
}
56
char_count
57
0 commit comments