Skip to content

Commit 9c072be

Browse files
committed
Implement SliceArg<D> for &T
1 parent 09884fc commit 9c072be

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/slice.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,24 @@ pub unsafe trait SliceArg<D: Dimension>: AsRef<[AxisSliceInfo]> {
324324
private_decl! {}
325325
}
326326

327+
unsafe impl<T, D> SliceArg<D> for &T
328+
where
329+
T: SliceArg<D> + ?Sized,
330+
D: Dimension,
331+
{
332+
type OutDim = T::OutDim;
333+
334+
fn in_ndim(&self) -> usize {
335+
T::in_ndim(self)
336+
}
337+
338+
fn out_ndim(&self) -> usize {
339+
T::out_ndim(self)
340+
}
341+
342+
private_impl! {}
343+
}
344+
327345
macro_rules! impl_slicearg_samedim {
328346
($in_dim:ty) => {
329347
unsafe impl<T, Dout> SliceArg<$in_dim> for SliceInfo<T, $in_dim, Dout>

0 commit comments

Comments
 (0)