Skip to content

Commit

Permalink
is_known_utf8 check taken from into_string
Browse files Browse the repository at this point in the history
  • Loading branch information
Borgerr committed Jun 24, 2024
1 parent 5d60720 commit da8e157
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/sys_common/wtf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ impl Wtf8Buf {
#[inline]
pub(crate) fn extend_from_slice(&mut self, other: &[u8]) {
self.bytes.extend_from_slice(other);
self.is_known_utf8 = self.is_known_utf8 || self.next_surrogate(0).is_none();
}
}

Expand Down

0 comments on commit da8e157

Please sign in to comment.