clippy: Don't need lazy eval for len calls.

This commit is contained in:
Bruce Mitchener 2023-08-15 14:46:35 +07:00
parent 6ac9d8995c
commit cb2ed212ed

View File

@ -226,7 +226,7 @@ where
SB: RawStorage<T, Const<1>, C>, SB: RawStorage<T, Const<1>, C>,
{ {
assert!(!rows.is_empty(), "At least one row must be given."); 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(); let ncols = rows[0].len();
assert!( assert!(
rows.len() == nrows, rows.len() == nrows,
@ -268,7 +268,7 @@ where
SB: RawStorage<T, R>, SB: RawStorage<T, R>,
{ {
assert!(!columns.is_empty(), "At least one column must be given."); 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(); let nrows = columns[0].len();
assert!( assert!(
columns.len() == ncols, columns.len() == ncols,