MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / from_static

Method from_static

aiscript-vm/src/string/interned.rs:122–133  ·  view source on GitHub ↗
(
        mc: &Mutation<'gc>,
        s: &'static S,
    )

Source from the content-addressed store, hash-verified

120 }
121
122 pub fn from_static<S: ?Sized + AsRef<[u8]>>(
123 mc: &Mutation<'gc>,
124 s: &'static S,
125 ) -> InternedString<'gc> {
126 InternedString(Gc::new(
127 mc,
128 StringInner {
129 hash: str_hash(s.as_ref()),
130 buffer: Buffer::Indirect(s.as_ref()),
131 },
132 ))
133 }
134
135 pub fn from_inner(inner: Gc<'gc, StringInner>) -> Self {
136 Self(inner)

Callers

nothing calls this directly

Calls 3

InternedStringClass · 0.85
str_hashFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected