From 3d66e48413d2a8cc53cbd6587ed02c285cf4462a Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Sat, 19 Sep 2020 15:49:55 +0200 Subject: [PATCH] silence clippy --- maxwell/src/sparse.rs | 6 +++--- shallow_water/src/lib.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/maxwell/src/sparse.rs b/maxwell/src/sparse.rs index e34eeef..42099b6 100644 --- a/maxwell/src/sparse.rs +++ b/maxwell/src/sparse.rs @@ -81,7 +81,7 @@ pub fn rhs_matrix(op: &dyn SbpOperator2d, grid: &super::Grid) -> Implicit { let a00 = if positive { &ky * &ky / (2.0 * &r) } else { - -&ky * &ky / (2.0 * &r) + -&ky * ky / (2.0 * &r) }; let a00 = diagonal(a00.as_slice().unwrap()); let a01 = &ky / 2.0; @@ -98,7 +98,7 @@ pub fn rhs_matrix(op: &dyn SbpOperator2d, grid: &super::Grid) -> Implicit { let a22 = if positive { &kx * &kx / (2.0 * &r) } else { - -&kx * &kx / (2.0 * &r) + -&kx * kx / (2.0 * &r) }; let a22 = diagonal(a22.as_slice().unwrap()); @@ -248,7 +248,7 @@ pub fn rhs_matrix_with_upwind_dissipation( let r = &kx * &kx + &ky * &ky; let s00 = &ky * &ky / &r; let s00 = diagonal(s00.as_slice().unwrap()); - let s02 = -&kx * &ky / &r; + let s02 = -&kx * ky / &r; let s02 = diagonal(s02.as_slice().unwrap()); let s11 = diagonal(r.as_slice().unwrap()); let s20 = &s02; diff --git a/shallow_water/src/lib.rs b/shallow_water/src/lib.rs index 3b6a91f..af7f5ad 100644 --- a/shallow_water/src/lib.rs +++ b/shallow_water/src/lib.rs @@ -286,6 +286,7 @@ impl System { let mut res = [0.0; 3]; for j in 0..3 { + #[allow(clippy::needless_range_loop)] for i in 0..3 { res[j] += mat[j][i] * q[i]; }