/// Transforms elements using a given function and return a new
/// collection.
Transforms elements using a given function and return a new
collection.
Transforms elements using a given function and return a new collection .
pub fn map<U, F: Fn(&T) -> U>(&self, f: F) -> NonEmptyVec<U> {
        let (e, es) = self.parts();
        let mut res = NonEmptyVec::new(f(e));
        res.extend(es.map(f));
        res
    }
pub fn map < U , F : Fn ( & T ) -> U > ( & self , f : F ) -> NonEmptyVec < U > { let ( e , es ) = self . parts ( ) ; let mut res = NonEmptyVec :: new ( f ( e ) ) ; res . extend ( es . map ( f ) ) ; res }
Transforms elements using a given function and return a new
collection.
Transforms elements using a given function and return a new collection .
&self
f
F