Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtkana committed Apr 2, 2024
1 parent e4e9859 commit 2b8b3a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/suffix_sum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<O: Op> SuffixSum2d<O> {
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]),
Expand All @@ -147,9 +147,9 @@ impl<O: Op> SuffixSum2d<O> {
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 {
Expand Down Expand Up @@ -182,7 +182,7 @@ where
impl<O: Op> From<Vec<Vec<O::Value>>> for SuffixSum2d<O> {
fn from(mut values: Vec<Vec<O::Value>>) -> 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());
Expand Down

0 comments on commit 2b8b3a9

Please sign in to comment.