Skip to content

Commit 425a70a

Browse files
committed
Removing if so it's more like the previous implementation.
1 parent 328abfb commit 425a70a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

library/core/src/str/iter.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ impl<'a> Iterator for Chars<'a> {
4949
// length in `char` is equal to the number of non-continuation bytes
5050
let mut char_count = 0;
5151
for &byte in self.iter {
52-
if !utf8_is_cont_byte(byte) {
53-
char_count += 1;
54-
}
52+
char_count += !utf8_is_cont_byte(byte) as usize;
5553
}
5654
char_count
5755
}

0 commit comments

Comments
 (0)