about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-02-26 04:15:02 +0100
committerGitHub <noreply@github.com>2025-02-26 04:15:02 +0100
commite121dcffbe28792619c3ed5227ec21ce5f0e4e34 (patch)
treeee3205bd5ae4f0be01b9d5fe3a70e8ca13963e76 /library/std/src/sys
parent1cdd38666b705d38a41ac56a34b8a564ec329690 (diff)
parenteb14652770451022d424a1c301a4416514464932 (diff)
downloadrust-e121dcffbe28792619c3ed5227ec21ce5f0e4e34.tar.gz
rust-e121dcffbe28792619c3ed5227ec21ce5f0e4e34.zip
Rollup merge of #137154 - thaliaarchi:wtf8-fast-paths, r=ChrisDenton
Add UTF-8 validation fast paths in `Wtf8Buf`

This adds two more fast paths for UTF-8 validation in `Wtf8Buf`, making use of the `is_known_utf8` flag added in https://github.com/rust-lang/rust/pull/96869 (Optimize `Wtf8Buf::into_string` for the case where it contains UTF-8).

r? `@ChrisDenton`
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/os_str/wtf8.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/os_str/wtf8.rs b/library/std/src/sys/os_str/wtf8.rs
index 19728d33990..8acec6f949f 100644
--- a/library/std/src/sys/os_str/wtf8.rs
+++ b/library/std/src/sys/os_str/wtf8.rs
@@ -41,13 +41,13 @@ impl AsInner<Wtf8> for Buf {
 
 impl fmt::Debug for Buf {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        fmt::Debug::fmt(self.as_slice(), f)
+        fmt::Debug::fmt(&self.inner, f)
     }
 }
 
 impl fmt::Display for Buf {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        fmt::Display::fmt(self.as_slice(), f)
+        fmt::Display::fmt(&self.inner, f)
     }
 }