MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / from_str_unchecked

Method from_str_unchecked

crates/data-structures/src/slim_slice.rs:1231–1236  ·  view source on GitHub ↗
(s: &'a str)

Source from the content-addressed store, hash-verified

1229 /// The caller must ensure that `s.len() <= u32::MAX`.
1230 #[inline]
1231 const unsafe fn from_str_unchecked(s: &'a str) -> Self {
1232 // SAFETY: Caller has promised that `s.len() <= u32::MAX`.
1233 let raw = unsafe { SlimSlice::from_slice_unchecked(s.as_bytes()) };
1234 // SAFETY: `s: &str` is always UTF-8.
1235 Self { raw }
1236 }
1237}
1238
1239impl Deref for SlimStr<'_> {

Callers

nothing calls this directly

Calls 1

as_bytesMethod · 0.45

Tested by

no test coverage detected