We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa71ec5 commit 3ce3059Copy full SHA for 3ce3059
src/dimension/remove_axis.rs
@@ -19,7 +19,10 @@ pub trait RemoveAxis : Dimension {
19
20
impl RemoveAxis for Dim<[Ix; 1]> {
21
#[inline]
22
- fn remove_axis(&self, _: Axis) -> Ix0 { Ix0() }
+ fn remove_axis(&self, axis: Axis) -> Ix0 {
23
+ debug_assert!(axis.index() < self.ndim());
24
+ Ix0()
25
+ }
26
}
27
28
impl RemoveAxis for Dim<[Ix; 2]> {
@@ -38,6 +41,7 @@ macro_rules! impl_remove_axis_array(
38
41
{
39
42
40
43
fn remove_axis(&self, axis: Axis) -> Self::Smaller {
44
45
let mut tup = Dim([0; $n - 1]);
46
47
let mut it = tup.slice_mut().iter_mut();
0 commit comments