about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/str/validations.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/str/validations.rs b/library/core/src/str/validations.rs
index 373a8212425..fc8f47dced4 100644
--- a/library/core/src/str/validations.rs
+++ b/library/core/src/str/validations.rs
@@ -22,7 +22,7 @@ fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 {
 /// bits `10`).
 #[inline]
 pub(super) fn utf8_is_cont_byte(byte: u8) -> bool {
-    (byte & !CONT_MASK) == TAG_CONT_U8
+    (byte as i8) < -64
 }
 
 #[inline]