diff options
| author | Thalia Archibald <thalia@archibald.dev> | 2025-02-07 11:54:02 -0800 |
|---|---|---|
| committer | Thalia Archibald <thalia@archibald.dev> | 2025-02-19 18:43:24 -0800 |
| commit | eb14652770451022d424a1c301a4416514464932 (patch) | |
| tree | c9520a47e1cf30064abb915879f8e386989dacbd /library/std/src/sys_common | |
| parent | 0842f2c65c766301be488256a18d89e90c3b6304 (diff) | |
| download | rust-eb14652770451022d424a1c301a4416514464932.tar.gz rust-eb14652770451022d424a1c301a4416514464932.zip | |
Skip scanning for surrogates when not known valid
Diffstat (limited to 'library/std/src/sys_common')
| -rw-r--r-- | library/std/src/sys_common/wtf8.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index 01cbb3e24ff..f9ec112b197 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -388,7 +388,7 @@ impl Wtf8Buf { _ => { // If we'll be pushing a string containing a surrogate, we may // no longer have UTF-8. - if other.next_surrogate(0).is_some() { + if self.is_known_utf8 && other.next_surrogate(0).is_some() { self.is_known_utf8 = false; } |
