1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
pub trait IntoBoxed<T: ?Sized> { fn into_boxed(self) -> Box<T>; } impl<T> IntoBoxed<T> for T { #[inline] fn into_boxed(self) -> Box<T> { Box::new(self) } } impl<T: ?Sized> IntoBoxed<T> for Box<T> { #[inline] fn into_boxed(self) -> Box<T> { self } }