@@ -44,8 +44,7 @@ use rawpointer::PointerExt;
4444///
4545/// ## Constructor methods for one-dimensional arrays.
4646impl < S , A > ArrayBase < S , Ix1 >
47- where
48- S : DataOwned < Elem = A > ,
47+ where S : DataOwned < Elem = A >
4948{
5049 /// Create a one-dimensional array from a vector (no copying needed).
5150 ///
5655 ///
5756 /// let array = Array::from_vec(vec![1., 2., 3., 4.]);
5857 /// ```
59- pub fn from_vec ( v : Vec < A > ) -> Self {
58+ pub fn from_vec ( v : Vec < A > ) -> Self
59+ {
6060 if mem:: size_of :: < A > ( ) == 0 {
6161 assert ! ( v. len( ) <= isize :: MAX as usize , "Length must fit in `isize`." , ) ;
6262 }
7373 /// let array = Array::from_iter(0..10);
7474 /// ```
7575 #[ allow( clippy:: should_implement_trait) ]
76- pub fn from_iter < I : IntoIterator < Item = A > > ( iterable : I ) -> Self {
76+ pub fn from_iter < I : IntoIterator < Item = A > > ( iterable : I ) -> Self
77+ {
7778 Self :: from_vec ( iterable. into_iter ( ) . collect ( ) )
7879 }
7980
@@ -116,8 +117,7 @@ where
116117 /// ```
117118 #[ cfg( feature = "std" ) ]
118119 pub fn range ( start : A , end : A , step : A ) -> Self
119- where
120- A : Float ,
120+ where A : Float
121121 {
122122 Self :: from ( to_vec ( linspace:: range ( start, end, step) ) )
123123 }
@@ -181,17 +181,15 @@ where
181181 /// ```
182182 #[ cfg( feature = "std" ) ]
183183 pub fn geomspace ( start : A , end : A , n : usize ) -> Option < Self >
184- where
185- A : Float ,
184+ where A : Float
186185 {
187186 Some ( Self :: from ( to_vec ( geomspace:: geomspace ( start, end, n) ?) ) )
188187 }
189188}
190189
191190/// ## Constructor methods for two-dimensional arrays.
192191impl < S , A > ArrayBase < S , Ix2 >
193- where
194- S : DataOwned < Elem = A > ,
192+ where S : DataOwned < Elem = A >
195193{
196194 /// Create an identity matrix of size `n` (square 2D array).
197195 ///
@@ -473,14 +471,14 @@ where
473471 /// );
474472 /// ```
475473 pub fn from_shape_vec < Sh > ( shape : Sh , v : Vec < A > ) -> Result < Self , ShapeError >
476- where
477- Sh : Into < StrideShape < D > > ,
474+ where Sh : Into < StrideShape < D > >
478475 {
479476 // eliminate the type parameter Sh as soon as possible
480477 Self :: from_shape_vec_impl ( shape. into ( ) , v)
481478 }
482479
483- fn from_shape_vec_impl ( shape : StrideShape < D > , v : Vec < A > ) -> Result < Self , ShapeError > {
480+ fn from_shape_vec_impl ( shape : StrideShape < D > , v : Vec < A > ) -> Result < Self , ShapeError >
481+ {
484482 let dim = shape. dim ;
485483 let is_custom = shape. strides . is_custom ( ) ;
486484 dimension:: can_index_slice_with_strides ( & v, & dim, & shape. strides , dimension:: CanIndexCheckMode :: OwnedMutable ) ?;
@@ -516,16 +514,16 @@ where
516514 /// 5. The strides must not allow any element to be referenced by two different
517515 /// indices.
518516 pub unsafe fn from_shape_vec_unchecked < Sh > ( shape : Sh , v : Vec < A > ) -> Self
519- where
520- Sh : Into < StrideShape < D > > ,
517+ where Sh : Into < StrideShape < D > >
521518 {
522519 let shape = shape. into ( ) ;
523520 let dim = shape. dim ;
524521 let strides = shape. strides . strides_for_dim ( & dim) ;
525522 Self :: from_vec_dim_stride_unchecked ( dim, strides, v)
526523 }
527524
528- unsafe fn from_vec_dim_stride_unchecked ( dim : D , strides : D , mut v : Vec < A > ) -> Self {
525+ unsafe fn from_vec_dim_stride_unchecked ( dim : D , strides : D , mut v : Vec < A > ) -> Self
526+ {
529527 // debug check for issues that indicates wrong use of this constructor
530528 debug_assert ! ( dimension:: can_index_slice( & v, & dim, & strides, CanIndexCheckMode :: OwnedMutable ) . is_ok( ) ) ;
531529
@@ -598,8 +596,7 @@ where
598596 /// # let _ = shift_by_two;
599597 /// ```
600598 pub fn uninit < Sh > ( shape : Sh ) -> ArrayBase < S :: MaybeUninit , D >
601- where
602- Sh : ShapeBuilder < Dim = D > ,
599+ where Sh : ShapeBuilder < Dim = D >
603600 {
604601 unsafe {
605602 let shape = shape. into_shape_with_order ( ) ;
0 commit comments