Skip to content

Commit

Permalink
Merge pull request #1279 from waywardmonkeys/clippy-less-lazy
Browse files Browse the repository at this point in the history
clippy: Don't need lazy eval for len calls.
  • Loading branch information
Andlon authored Aug 15, 2023
2 parents 1e40308 + cb2ed21 commit f404bcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/base/construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ where
SB: RawStorage<T, Const<1>, 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,
Expand Down Expand Up @@ -268,7 +268,7 @@ where
SB: RawStorage<T, R>,
{
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,
Expand Down

0 comments on commit f404bcb

Please sign in to comment.