We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c07e558 commit a623ea5Copy full SHA for a623ea5
library/core/src/str/iter.rs
@@ -47,7 +47,7 @@ impl<'a> Iterator for Chars<'a> {
47
#[inline]
48
fn count(self) -> usize {
49
// length in `char` is equal to the number of non-continuation bytes
50
- self.iter.map(|&byte| !utf8_is_cont_byte(byte) as usize).sum()
+ self.iter.filter(|&&byte| !utf8_is_cont_byte(byte)).count()
51
}
52
53
0 commit comments