1 2 3 4 5 6 7 8 9 10 11 12 13
pub trait VecInto<D> { fn vec_into(self) -> Vec<D>; } impl<E, D> VecInto<D> for Vec<E> where E: Into<D>, { #[inline] fn vec_into(self) -> Vec<D> { self.into_iter().map(std::convert::Into::into).collect() } }