Skip to content

Commit dbfc619

Browse files
quality of impl impl
1 parent 712adca commit dbfc619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys_common/wtf8.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +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 = false;
483+
self.is_known_utf8 = self.is_known_utf8 && str::from_utf8(other).is_ok();
484484
}
485485
}
486486

0 commit comments

Comments
 (0)