Skip to content

Commit 572dea0

Browse files
committed
FIX: Add isize get/setters for dimensions as strides
1 parent 1a8377e commit 572dea0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/dimension/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,20 @@ pub trait DimensionExt
313313
/// *Panics* if `axis` is out of bounds.
314314
#[track_caller]
315315
fn set_axis(&mut self, axis: Axis, value: Ix);
316+
317+
/// Get as stride
318+
#[inline]
319+
fn get_stride(&self, axis: Axis) -> isize
320+
{
321+
self.axis(axis) as isize
322+
}
323+
324+
/// Set as stride
325+
#[inline]
326+
fn set_stride(&mut self, axis: Axis, value: isize)
327+
{
328+
self.set_axis(axis, value as usize)
329+
}
316330
}
317331

318332
impl<D> DimensionExt for D

0 commit comments

Comments
 (0)