Merge pull request #1279 from waywardmonkeys/clippy-less-lazy

clippy: Don't need lazy eval for len calls.
This commit is contained in:
Andreas Borgen Longva 2023-08-15 11:01:13 +02:00 committed by GitHub
commit f404bcbd6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,