pub fn map<T, Q, F>(vec: &Vec<T>, map_func: F) -> Vec<Q>
where
    F: Fn(&T) -> Q
{
    let mut ret = vec![];

    for t in vec {
        ret.push(map_func(t));
    }

    ret
}
/// maps each element in the vector with a map function, and returns the new vector
maps each element in the vector with a map function, and returns the new vector
maps each element in the vector with a map function and returns the new vector
pub fn map<T, Q, F>(vec: &Vec<T>, map_func: F) -> Vec<Q>
where
    F: Fn(&T) -> Q
{
    let mut ret = vec![];
    for t in vec {
        ret.push(map_func(t));
    }
    ret
}
pub fn map < T , Q , F > ( vec : & Vec < T > , map_func : F ) -> Vec < Q > where F : Fn ( & T ) -> Q { let mut ret = vec ! [ ] ; for t in vec { ret . push ( map_func ( t ) ) ; } ret }
maps each element in the vector with a map function, and returns the new vector
maps each element in the vector with a map function and returns the new vector
vec
&Vec<T>
map_func
F
vec
&Vec<T>
map_func
F