From cb2ed212eda8acfb01fa65951eb5b47a8c626226 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 15 Aug 2023 14:46:35 +0700 Subject: [PATCH] clippy: Don't need lazy eval for len calls. --- src/base/construction.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/construction.rs b/src/base/construction.rs index aabe75d8..43475179 100644 --- a/src/base/construction.rs +++ b/src/base/construction.rs @@ -226,7 +226,7 @@ where SB: RawStorage, C>, { assert!(!rows.is_empty(), "At least one row must be given."); - let nrows = R::try_to_usize().unwrap_or_else(|| rows.len()); + let nrows = R::try_to_usize().unwrap_or(rows.len()); let ncols = rows[0].len(); assert!( rows.len() == nrows, @@ -268,7 +268,7 @@ where SB: RawStorage, { assert!(!columns.is_empty(), "At least one column must be given."); - let ncols = C::try_to_usize().unwrap_or_else(|| columns.len()); + let ncols = C::try_to_usize().unwrap_or(columns.len()); let nrows = columns[0].len(); assert!( columns.len() == ncols,