Skip to content

Commit

Permalink
matrix: remove some needless borrows
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure authored and TeXitoi committed Jun 6, 2023
1 parent 54843d4 commit 448db60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ where
{
let mut keys = [[false; CS]; RS];

for (ri, row) in (&mut self.rows).iter_mut().enumerate() {
for (ri, row) in self.rows.iter_mut().enumerate() {
row.set_low()?;
delay();
for (ci, col) in (&self.cols).iter().enumerate() {
for (ci, col) in self.cols.iter().enumerate() {
if col.is_low()? {
keys[ri][ci] = true;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ where
{
let mut keys = [[false; CS]; RS];

for (ri, row) in (&mut self.pins).iter_mut().enumerate() {
for (ri, row) in self.pins.iter_mut().enumerate() {
for (ci, col_option) in row.iter().enumerate() {
if let Some(col) = col_option {
if col.is_low()? {
Expand Down

0 comments on commit 448db60

Please sign in to comment.