File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -451,13 +451,15 @@ where
451
451
/// `Din::NDIM.unwrap()`. Otherwise, the value is calculated by iterating
452
452
/// over the `AxisSliceInfo` elements.
453
453
pub fn in_ndim ( & self ) -> usize {
454
- Din :: NDIM . unwrap_or_else ( || {
454
+ if let Some ( ndim) = Din :: NDIM {
455
+ ndim
456
+ } else {
455
457
self . indices
456
458
. as_ref ( )
457
459
. iter ( )
458
460
. filter ( |s| !s. is_new_axis ( ) )
459
461
. count ( )
460
- } )
462
+ }
461
463
}
462
464
463
465
/// Returns the number of dimensions after calling
@@ -468,13 +470,15 @@ where
468
470
/// `Dout::NDIM.unwrap()`. Otherwise, the value is calculated by iterating
469
471
/// over the `AxisSliceInfo` elements.
470
472
pub fn out_ndim ( & self ) -> usize {
471
- Dout :: NDIM . unwrap_or_else ( || {
473
+ if let Some ( ndim) = Dout :: NDIM {
474
+ ndim
475
+ } else {
472
476
self . indices
473
477
. as_ref ( )
474
478
. iter ( )
475
479
. filter ( |s| !s. is_index ( ) )
476
480
. count ( )
477
- } )
481
+ }
478
482
}
479
483
}
480
484
You can’t perform that action at this time.
0 commit comments