File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -639,6 +639,8 @@ pub trait RemoveAxis : Dimension {
639
639
}
640
640
641
641
macro_rules! impl_shrink(
642
+ ( $_a: ident, ) => { } ; // implement this case manually below
643
+ ( $_a: ident, $_b: ident, ) => { } ; // implement this case manually below
642
644
( $from: ident, $( $more: ident, ) * ) => (
643
645
impl RemoveAxis for ( $from $( , $more) * )
644
646
{
@@ -665,6 +667,22 @@ impl RemoveAxis for ($from $(,$more)*)
665
667
)
666
668
) ;
667
669
670
+ impl RemoveAxis for Ix {
671
+ type Smaller = ( ) ;
672
+ #[ inline]
673
+ fn remove_axis ( & self , _: Axis ) { }
674
+ }
675
+
676
+ impl RemoveAxis for ( Ix , Ix ) {
677
+ type Smaller = Ix ;
678
+ #[ inline]
679
+ fn remove_axis ( & self , axis : Axis ) -> Ix {
680
+ let axis = axis. axis ( ) ;
681
+ debug_assert ! ( axis < self . ndim( ) ) ;
682
+ if axis == 0 { self . 1 } else { self . 0 }
683
+ }
684
+ }
685
+
668
686
macro_rules! impl_shrink_recursive(
669
687
( $ix: ident, ) => ( impl_shrink!( $ix, ) ; ) ;
670
688
( $ix1: ident, $( $ix: ident, ) * ) => (
You can’t perform that action at this time.
0 commit comments