From 2b8b3a9ef989d2238e640bf8d25ab986cad4177f Mon Sep 17 00:00:00 2001 From: Nagata Kana Date: Wed, 3 Apr 2024 04:53:14 +0900 Subject: [PATCH] lint --- libs/suffix_sum/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/suffix_sum/src/lib.rs b/libs/suffix_sum/src/lib.rs index c5ddcb48..e0b9cfd3 100644 --- a/libs/suffix_sum/src/lib.rs +++ b/libs/suffix_sum/src/lib.rs @@ -132,7 +132,7 @@ impl SuffixSum2d { let (i0, i1) = open(i, self.values.len() - 1); let (j0, j1) = open(j, self.values[0].len()); assert!(i0 <= i1 && i1 < self.values.len()); - assert!(j0 <= j1 && j1 <= self.values.get(0).map_or(0, |v| v.len())); + assert!(j0 <= j1 && j1 <= self.values.get(0).map_or(0, Vec::len)); O::div( &O::mul(&self.values[i0][j0], &self.values[i1][j1]), &O::mul(&self.values[i0][j1], &self.values[i1][j0]), @@ -147,9 +147,9 @@ impl SuffixSum2d { let mut values = self.values.clone(); let h = values.len(); let w = values[0].len(); - for i in 0..h { + for values in &mut values { for j in 0..w - 1 { - values[i][j] = O::div(&values[i][j], &values[i][j + 1]); + values[j] = O::div(&values[j], &values[j + 1]); } } for i in 0..h - 1 { @@ -182,7 +182,7 @@ where impl From>> for SuffixSum2d { fn from(mut values: Vec>) -> Self { let h = values.len(); - let w = values.get(0).map_or(0, |v| v.len()); + let w = values.get(0).map_or(0, Vec::len); values.push(repeat_with(O::identity).take(w).collect()); for values in &mut values { values.push(O::identity());