Skip to content

Commit be5e8c8

Browse files
committed
FIX: Add isize get/setters for dimensions as strides
1 parent b7a953e commit be5e8c8

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
@@ -312,6 +312,18 @@ pub trait DimensionExt {
312312
///
313313
/// *Panics* if `axis` is out of bounds.
314314
fn set_axis(&mut self, axis: Axis, value: Ix);
315+
316+
/// Get as stride
317+
#[inline]
318+
fn get_stride(&self, axis: Axis) -> isize {
319+
self.axis(axis) as isize
320+
}
321+
322+
/// Set as stride
323+
#[inline]
324+
fn set_stride(&mut self, axis: Axis, value: isize) {
325+
self.set_axis(axis, value as usize)
326+
}
315327
}
316328

317329
impl<D> DimensionExt for D

0 commit comments

Comments
 (0)