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

Method from_iter

cranelift/entity/src/map.rs:245–254  ·  view source on GitHub ↗
(iter: T)

Source from the content-addressed store, hash-verified

243 V: Clone + Default,
244{
245 fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
246 let iter = iter.into_iter();
247 let (min, max) = iter.size_hint();
248 let cap = max.unwrap_or_else(|| 2 * min);
249 let mut map = Self::with_capacity(cap);
250 for (k, v) in iter {
251 map[k] = v;
252 }
253 map
254 }
255}
256
257/// Immutable indexing into an `SecondaryMap`.

Callers

nothing calls this directly

Calls 2

into_iterMethod · 0.45
size_hintMethod · 0.45

Tested by

no test coverage detected