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

Method try_clone

crates/core/src/alloc/vec.rs:74–80  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

72 T: TryClone,
73{
74 fn try_clone(&self) -> Result<Self, OutOfMemory> {
75 let mut v = TryVec::with_capacity(self.len())?;
76 for x in self {
77 v.push(x.try_clone()?).expect("reserved capacity");
78 }
79 Ok(v)
80 }
81}
82
83impl<T> TryVec<T> {

Callers 2

from_elemMethod · 0.45
resizeMethod · 0.45

Calls 4

OkFunction · 0.85
lenMethod · 0.45
expectMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected