From 99da364fa86fdfdb3f0048438b2cc17d187c46ca Mon Sep 17 00:00:00 2001 From: Harrison McCullough Date: Mon, 20 May 2024 22:45:39 -0700 Subject: [PATCH] Resolve clippy warnings --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cedca78..27ac7bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -227,7 +227,7 @@ impl Array2D { where T: Clone, { - let row_len = elements.get(0).map(Vec::len).unwrap_or(0); + let row_len = elements.first().map(Vec::len).unwrap_or(0); if !elements.iter().all(|row| row.len() == row_len) { return Err(Error::DimensionMismatch); } @@ -262,7 +262,7 @@ impl Array2D { where T: Clone, { - let column_len = elements.get(0).map(Vec::len).unwrap_or(0); + let column_len = elements.first().map(Vec::len).unwrap_or(0); if !elements.iter().all(|column| column.len() == column_len) { return Err(Error::DimensionMismatch); }