reuse_vec

Function reuse_vec 

Source
pub fn reuse_vec<T, U>(v: Vec<T>) -> Vec<U>
Expand description

Re-uses the memory for a vec while clearing it. Allows casting the type of the vec at the same time. The stdlib specializes collect() to re-use the memory.