MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / as_str

Method as_str

src/path/dec_int.rs:208–212  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

206 /// Return the raw byte buffer as a `&str`.
207 #[inline]
208 pub fn as_str(&self) -> &str {
209 // SAFETY: `DecInt` always holds a formatted decimal number, so it's
210 // always valid UTF-8.
211 unsafe { core::str::from_utf8_unchecked(self.as_bytes()) }
212 }
213
214 /// Return the raw byte buffer as a `&CStr`.
215 #[inline]

Callers 1

fmtMethod · 0.45

Calls 1

as_bytesMethod · 0.45

Tested by

no test coverage detected