2 #![allow(non_camel_case_types)]
6 fn map_<U, F>(x: &Self, f: F) -> Vec<U> where F: FnMut(&T) -> U;
9 impl<T> vec_utils<T> for Vec<T> {
10 fn map_<U, F>(x: &Vec<T> , mut f: F) -> Vec<U> where F: FnMut(&T) -> U {
11 let mut r = Vec::new();
20 assert_eq!(vec_utils::map_(&vec![1,2,3], |&x| x+1), [2,3,4]);