pub fn reuse_vec<T, U>(v: Vec<T>) -> Vec<U>
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.