File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,13 +451,15 @@ where
451451 /// `Din::NDIM.unwrap()`. Otherwise, the value is calculated by iterating
452452 /// over the `AxisSliceInfo` elements.
453453 pub fn in_ndim ( & self ) -> usize {
454- Din :: NDIM . unwrap_or_else ( || {
454+ if let Some ( ndim) = Din :: NDIM {
455+ ndim
456+ } else {
455457 self . indices
456458 . as_ref ( )
457459 . iter ( )
458460 . filter ( |s| !s. is_new_axis ( ) )
459461 . count ( )
460- } )
462+ }
461463 }
462464
463465 /// Returns the number of dimensions after calling
@@ -468,13 +470,15 @@ where
468470 /// `Dout::NDIM.unwrap()`. Otherwise, the value is calculated by iterating
469471 /// over the `AxisSliceInfo` elements.
470472 pub fn out_ndim ( & self ) -> usize {
471- Dout :: NDIM . unwrap_or_else ( || {
473+ if let Some ( ndim) = Dout :: NDIM {
474+ ndim
475+ } else {
472476 self . indices
473477 . as_ref ( )
474478 . iter ( )
475479 . filter ( |s| !s. is_index ( ) )
476480 . count ( )
477- } )
481+ }
478482 }
479483}
480484
You can’t perform that action at this time.
0 commit comments