diff options
| author | Giles Cope <gilescope@gmail.com> | 2021-01-26 11:26:58 +0000 |
|---|---|---|
| committer | Giles Cope <gilescope@gmail.com> | 2021-01-26 11:26:58 +0000 |
| commit | 425a70a460abac1182a792c6c2af6dff69663c3c (patch) | |
| tree | d6dd12b002dc99773e0cd68f81d4e42c8433a106 | |
| parent | 328abfb9431c486ab2d0b9ebd7f6115805f613de (diff) | |
| download | rust-425a70a460abac1182a792c6c2af6dff69663c3c.tar.gz rust-425a70a460abac1182a792c6c2af6dff69663c3c.zip | |
Removing if so it's more like the previous implementation.
| -rw-r--r-- | library/core/src/str/iter.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/library/core/src/str/iter.rs b/library/core/src/str/iter.rs index c3784343478..34c31d599a3 100644 --- a/library/core/src/str/iter.rs +++ b/library/core/src/str/iter.rs @@ -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 } |
