MCPcopy Index your code
hub / github.com/RustPython/RustPython / from_iter

Method from_iter

crates/stdlib/src/posixsubprocess.rs:98–108  ·  view source on GitHub ↗
(iter: I)

Source from the content-addressed store, hash-verified

96
97impl<'a, T: AsRef<CStr>> FromIterator<&'a T> for CharPtrVec<'a> {
98 fn from_iter<I: IntoIterator<Item = &'a T>>(iter: I) -> Self {
99 let vec = iter
100 .into_iter()
101 .map(|x| x.as_ref().as_ptr())
102 .chain(core::iter::once(core::ptr::null()))
103 .collect();
104 Self {
105 vec,
106 marker: PhantomData,
107 }
108 }
109}
110
111impl<'a> Deref for CharPtrVec<'a> {

Callers

nothing calls this directly

Calls 7

onceFunction · 0.85
collectMethod · 0.80
chainMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45
as_ptrMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected