Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Same instructions, but simpler.
  • Loading branch information
gilescope committed Jan 26, 2021
commit a623ea5301737507a8229c2ddae74b20f727bd1b
2 changes: 1 addition & 1 deletion library/core/src/str/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<'a> Iterator for Chars<'a> {
#[inline]
fn count(self) -> usize {
// length in `char` is equal to the number of non-continuation bytes
self.iter.map(|&byte| !utf8_is_cont_byte(byte) as usize).sum()
self.iter.filter(|&&byte| !utf8_is_cont_byte(byte)).count()
}

#[inline]
Expand Down