1pub trait VecMap<T> { 2 fn map<U, F>(self, f: F) -> Vec<U> 3 where 4 F: FnMut(T) -> U; 5} 6 7impl<T> VecMap<T> for Vec<T> { 8 fn map<U, F>(self, f: F) -> Vec<U> 9 where 10 F: FnMut(T) -> U, 11 { 12 self.into_iter().map(f).collect() 13 } 14}