We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4314d72 commit 4a9a323Copy full SHA for 4a9a323
src/slice.rs
@@ -140,6 +140,8 @@ impl AxisSliceInfo {
140
///
141
/// `step` must be nonzero.
142
/// (This method checks with a debug assertion that `step` is not zero.)
143
+ ///
144
+ /// **Panics** if `self` is not the `AxisSliceInfo::Slice` variant.
145
#[inline]
146
pub fn step_by(self, step: isize) -> Self {
147
debug_assert_ne!(step, 0, "AxisSliceInfo::step_by: step must be nonzero");
@@ -153,8 +155,7 @@ impl AxisSliceInfo {
153
155
end,
154
156
step: orig_step * step,
157
},
- AxisSliceInfo::Index(s) => AxisSliceInfo::Index(s),
- AxisSliceInfo::NewAxis => AxisSliceInfo::NewAxis,
158
+ _ => panic!("AxisSliceInfo::step_by: `self` must be the `Slice` variant"),
159
}
160
161
0 commit comments