@@ -33,7 +33,7 @@ impl<A, S: RawData<Elem = A>, D: Dimension> ArrayBase<S, D>
3333 pub fn get_ptr < I > ( & self , index : I ) -> Option < * const A >
3434 where I : NdIndex < D >
3535 {
36- < Self as AsRef < RawRef < _ , _ > > > :: as_ref ( self ) . get_ptr ( index)
36+ self . as_raw_ref ( ) . get_ptr ( index)
3737 }
3838
3939 /// Return a raw pointer to the element at `index`, or return `None`
@@ -58,7 +58,7 @@ impl<A, S: RawData<Elem = A>, D: Dimension> ArrayBase<S, D>
5858 S : RawDataMut < Elem = A > ,
5959 I : NdIndex < D > ,
6060 {
61- < Self as AsMut < RawRef < _ , _ > > > :: as_mut ( self ) . get_mut_ptr ( index)
61+ self . as_raw_ref_mut ( ) . get_mut_ptr ( index)
6262 }
6363
6464 /// Return a pointer to the first element in the array.
@@ -73,14 +73,14 @@ impl<A, S: RawData<Elem = A>, D: Dimension> ArrayBase<S, D>
7373 #[ inline( always) ]
7474 pub fn as_ptr ( & self ) -> * const A
7575 {
76- < Self as AsRef < RawRef < _ , _ > > > :: as_ref ( self ) . as_ptr ( )
76+ self . as_raw_ref ( ) . as_ptr ( )
7777 }
7878
7979 /// Return a raw view of the array.
8080 #[ inline]
8181 pub fn raw_view ( & self ) -> RawArrayView < S :: Elem , D >
8282 {
83- < Self as AsRef < RawRef < _ , _ > > > :: as_ref ( self ) . raw_view ( )
83+ self . as_raw_ref ( ) . raw_view ( )
8484 }
8585}
8686
@@ -111,7 +111,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
111111 pub fn slice_collapse < I > ( & mut self , info : I )
112112 where I : SliceArg < D >
113113 {
114- self . as_mut ( ) . slice_collapse ( info) ;
114+ self . as_layout_ref_mut ( ) . slice_collapse ( info) ;
115115 }
116116
117117 /// Slice the array in place along the specified axis.
@@ -121,7 +121,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
121121 #[ track_caller]
122122 pub fn slice_axis_inplace ( & mut self , axis : Axis , indices : Slice )
123123 {
124- self . as_mut ( ) . slice_axis_inplace ( axis, indices) ;
124+ self . as_layout_ref_mut ( ) . slice_axis_inplace ( axis, indices) ;
125125 }
126126
127127 /// Slice the array in place, with a closure specifying the slice for each
@@ -135,7 +135,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
135135 pub fn slice_each_axis_inplace < F > ( & mut self , f : F )
136136 where F : FnMut ( AxisDescription ) -> Slice
137137 {
138- self . as_mut ( ) . slice_each_axis_inplace ( f) ;
138+ self . as_layout_ref_mut ( ) . slice_each_axis_inplace ( f) ;
139139 }
140140
141141 /// Selects `index` along the axis, collapsing the axis into length one.
@@ -144,7 +144,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
144144 #[ track_caller]
145145 pub fn collapse_axis ( & mut self , axis : Axis , index : usize )
146146 {
147- self . as_mut ( ) . collapse_axis ( axis, index) ;
147+ self . as_layout_ref_mut ( ) . collapse_axis ( axis, index) ;
148148 }
149149
150150 /// Return `true` if the array data is laid out in contiguous “C order” in
@@ -154,19 +154,19 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
154154 /// contiguous in memory, it has custom strides, etc.
155155 pub fn is_standard_layout ( & self ) -> bool
156156 {
157- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . is_standard_layout ( )
157+ self . as_layout_ref ( ) . is_standard_layout ( )
158158 }
159159
160160 /// Return true if the array is known to be contiguous.
161161 pub ( crate ) fn is_contiguous ( & self ) -> bool
162162 {
163- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . is_contiguous ( )
163+ self . as_layout_ref ( ) . is_contiguous ( )
164164 }
165165
166166 /// Return an iterator over the length and stride of each axis.
167167 pub fn axes ( & self ) -> Axes < ' _ , D >
168168 {
169- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . axes ( )
169+ self . as_layout_ref ( ) . axes ( )
170170 }
171171
172172 /*
@@ -180,7 +180,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
180180 /// preferring axes with len > 1.
181181 pub fn max_stride_axis ( & self ) -> Axis
182182 {
183- LayoutRef :: max_stride_axis ( self . as_ref ( ) )
183+ self . as_layout_ref ( ) . max_stride_axis ( )
184184 }
185185
186186 /// Reverse the stride of `axis`.
@@ -189,7 +189,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
189189 #[ track_caller]
190190 pub fn invert_axis ( & mut self , axis : Axis )
191191 {
192- self . as_mut ( ) . invert_axis ( axis) ;
192+ self . as_layout_ref_mut ( ) . invert_axis ( axis) ;
193193 }
194194
195195 /// Swap axes `ax` and `bx`.
@@ -211,7 +211,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
211211 #[ track_caller]
212212 pub fn swap_axes ( & mut self , ax : usize , bx : usize )
213213 {
214- self . as_mut ( ) . swap_axes ( ax, bx) ;
214+ self . as_layout_ref_mut ( ) . swap_axes ( ax, bx) ;
215215 }
216216
217217 /// If possible, merge in the axis `take` to `into`.
@@ -252,13 +252,13 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
252252 #[ track_caller]
253253 pub fn merge_axes ( & mut self , take : Axis , into : Axis ) -> bool
254254 {
255- self . as_mut ( ) . merge_axes ( take, into)
255+ self . as_layout_ref_mut ( ) . merge_axes ( take, into)
256256 }
257257
258258 /// Return the total number of elements in the array.
259259 pub fn len ( & self ) -> usize
260260 {
261- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . len ( )
261+ self . as_layout_ref ( ) . len ( )
262262 }
263263
264264 /// Return the length of `axis`.
@@ -270,27 +270,27 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
270270 #[ track_caller]
271271 pub fn len_of ( & self , axis : Axis ) -> usize
272272 {
273- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . len_of ( axis)
273+ self . as_layout_ref ( ) . len_of ( axis)
274274 }
275275
276276 /// Return whether the array has any elements
277277 pub fn is_empty ( & self ) -> bool
278278 {
279- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . is_empty ( )
279+ self . as_layout_ref ( ) . is_empty ( )
280280 }
281281
282282 /// Return the number of dimensions (axes) in the array
283283 pub fn ndim ( & self ) -> usize
284284 {
285- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . ndim ( )
285+ self . as_layout_ref ( ) . ndim ( )
286286 }
287287
288288 /// Return the shape of the array in its “pattern” form,
289289 /// an integer in the one-dimensional case, tuple in the n-dimensional cases
290290 /// and so on.
291291 pub fn dim ( & self ) -> D :: Pattern
292292 {
293- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . dim ( )
293+ self . as_layout_ref ( ) . dim ( )
294294 }
295295
296296 /// Return the shape of the array as it's stored in the array.
@@ -309,7 +309,7 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
309309 /// ```
310310 pub fn raw_dim ( & self ) -> D
311311 {
312- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . raw_dim ( )
312+ self . as_layout_ref ( ) . raw_dim ( )
313313 }
314314
315315 /// Return the shape of the array as a slice.
@@ -338,13 +338,13 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
338338 /// ```
339339 pub fn shape ( & self ) -> & [ usize ]
340340 {
341- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . shape ( )
341+ self . as_layout_ref ( ) . shape ( )
342342 }
343343
344344 /// Return the strides of the array as a slice.
345345 pub fn strides ( & self ) -> & [ isize ]
346346 {
347- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . strides ( )
347+ self . as_layout_ref ( ) . strides ( )
348348 }
349349
350350 /// Return the stride of `axis`.
@@ -356,6 +356,6 @@ impl<S: RawData, D: Dimension> ArrayBase<S, D>
356356 #[ track_caller]
357357 pub fn stride_of ( & self , axis : Axis ) -> isize
358358 {
359- < Self as AsRef < LayoutRef < _ , _ > > > :: as_ref ( self ) . stride_of ( axis)
359+ self . as_layout_ref ( ) . stride_of ( axis)
360360 }
361361}
0 commit comments