Skip to content

Commit da8e157

Browse files
committed
is_known_utf8 check taken from into_string
1 parent 5d60720 commit da8e157

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/sys_common/wtf8.rs

+1
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ impl Wtf8Buf {
480480
#[inline]
481481
pub(crate) fn extend_from_slice(&mut self, other: &[u8]) {
482482
self.bytes.extend_from_slice(other);
483+
self.is_known_utf8 = self.is_known_utf8 || self.next_surrogate(0).is_none();
483484
}
484485
}
485486

0 commit comments

Comments
 (0)