From 425a70a460abac1182a792c6c2af6dff69663c3c Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 26 Jan 2021 11:26:58 +0000 Subject: [PATCH] Removing if so it's more like the previous implementation. --- library/core/src/str/iter.rs | 4 +--- 1 file changed, 1 insertion(+), 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 }