MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / visit_str

Method visit_str

crates/core/src/alloc/string.rs:113–121  ·  view source on GitHub ↗
(self, v: &str)

Source from the content-addressed store, hash-verified

111 }
112
113 fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
114 where
115 E: serde::de::Error,
116 {
117 let mut s = TryString::new();
118 s.reserve_exact(v.len()).map_err(|oom| E::custom(oom))?;
119 s.push_str(v).expect("reserved capacity");
120 Ok(s)
121 }
122 }
123
124 // NB: do not use `deserialize_string` as that eagerly allocates the

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
newFunction · 0.50
reserve_exactMethod · 0.45
lenMethod · 0.45
expectMethod · 0.45
push_strMethod · 0.45

Tested by

no test coverage detected