@@ -57,7 +57,7 @@ impl<'a> Reader<'a> {
5757
5858 /// Reads a slice of an n-dimensional array.
5959 /// If the dimensionality `D` has a fixed number of dimensions, it must match the dimensionality of
60- /// the slice, after singleton dimensions are dropped.
60+ /// the slice, after singleton dimensions are dropped.
6161 /// Use the multi-dimensional slice macro `s![]` from `ndarray` to conveniently create
6262 /// a multidimensional slice.
6363 pub fn read_slice < T , S , D > ( & self , slice : & SliceInfo < S , D > ) -> Result < Array < T , D > >
@@ -86,7 +86,12 @@ impl<'a> Reader<'a> {
8686 // Check that return dimensionality is 0.
8787 if let Some ( ndim) = D :: NDIM {
8888 let obj_ndim = 0 ;
89- ensure ! ( obj_ndim == ndim, "ndim mismatch: slice outputs dims {}, output type dims {}" , obj_ndim, ndim) ;
89+ ensure ! (
90+ obj_ndim == ndim,
91+ "ndim mismatch: slice outputs dims {}, output type dims {}" ,
92+ obj_ndim,
93+ ndim
94+ ) ;
9095 }
9196
9297 // Fall back to a simple read for the scalar case
@@ -111,7 +116,12 @@ impl<'a> Reader<'a> {
111116 // axes are dropped.
112117 if let Some ( ndim) = D :: NDIM {
113118 let obj_ndim = reduced_shape. len ( ) ;
114- ensure ! ( obj_ndim == ndim, "ndim mismatch: slice outputs dims {}, output type dims {}" , obj_ndim, ndim) ;
119+ ensure ! (
120+ obj_ndim == ndim,
121+ "ndim mismatch: slice outputs dims {}, output type dims {}" ,
122+ obj_ndim,
123+ ndim
124+ ) ;
115125 }
116126
117127 let mspace = Dataspace :: try_new ( & out_shape, false ) ?;
@@ -177,7 +187,6 @@ impl<'a> Reader<'a> {
177187 self . read ( )
178188 }
179189
180-
181190 /// Reads the given `slice` of the dataset into a 2-dimensional array.
182191 /// The slice must yield a 2-dimensional result.
183192 pub fn read_slice_2d < T , S > ( & self , slice : & SliceInfo < S , ndarray:: Ix2 > ) -> Result < Array2 < T > >
@@ -530,7 +539,7 @@ impl Container {
530539
531540 /// Reads a slice of an n-dimensional array.
532541 /// If the dimensionality `D` has a fixed number of dimensions, it must match the dimensionality of
533- /// the slice, after singleton dimensions are dropped.
542+ /// the slice, after singleton dimensions are dropped.
534543 /// Use the multi-dimensional slice macro `s![]` from `ndarray` to conveniently create
535544 /// a multidimensional slice.
536545 pub fn read_slice < T , S , D > ( & self , slice : & SliceInfo < S , D > ) -> Result < Array < T , D > >
0 commit comments