diff --git a/src/arraytraits.rs b/src/arraytraits.rs index 421fc4713..db0c0892e 100644 --- a/src/arraytraits.rs +++ b/src/arraytraits.rs @@ -148,6 +148,18 @@ where { } +impl From> for ArrayBase +where + S: DataOwned, +{ + /// Create a one-dimensional array from a boxed slice (no copying needed). + /// + /// **Panics** if the length is greater than `isize::MAX`. + fn from(b: Box<[A]>) -> Self { + Self::from_vec(b.into_vec()) + } +} + impl From> for ArrayBase where S: DataOwned,