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

Function from_str

crates/data-structures/src/slim_slice.rs:1367–1374  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

1365/// Panics when `str.len() > u32::MAX`.
1366#[inline]
1367pub const fn from_str(s: &str) -> SlimStr<'_> {
1368 if s.len() > u32::MAX as usize {
1369 panic!("length didn't fit in `u32`");
1370 }
1371
1372 // SAFETY: ^-- satisfies `len <= u32::MAX`.
1373 unsafe { SlimStr::from_str_unchecked(s) }
1374}
1375
1376/// Converts `&str` into the owned slim limited version.
1377///

Callers 15

read_package_jsonFunction · 0.85
newMethod · 0.85
result_tpsFunction · 0.85
generateMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85
bearerMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by 15

exec_procedure_http_okFunction · 0.68
str_callFunction · 0.68
logs_filteredFunction · 0.68
get_templatesFunction · 0.68
test_register_tldFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…