Skip to content

Commit

Permalink
Removing if so it's more like the previous implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilescope committed Jan 26, 2021
1 parent 328abfb commit 425a70a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/core/src/str/iter.rs
Expand Up @@ -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
}
Expand Down

0 comments on commit 425a70a

Please sign in to comment.