Skip to content

Commit 3070113

Browse files
committed
FIX: Add isize get/setters for dimensions as strides
1 parent 68f649a commit 3070113

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/dimension/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,18 @@ pub trait DimensionExt {
316316
///
317317
/// *Panics* if `axis` is out of bounds.
318318
fn set_axis(&mut self, axis: Axis, value: Ix);
319+
320+
/// Get as stride
321+
#[inline]
322+
fn get_stride(&self, axis: Axis) -> isize {
323+
self.axis(axis) as isize
324+
}
325+
326+
/// Set as stride
327+
#[inline]
328+
fn set_stride(&mut self, axis: Axis, value: isize) {
329+
self.set_axis(axis, value as usize)
330+
}
319331
}
320332

321333
impl<D> DimensionExt for D

0 commit comments

Comments
 (0)