silence clippy

This commit is contained in:
Magnus Ulimoen 2020-09-19 15:49:55 +02:00
parent 4eb653da23
commit 3d66e48413
2 changed files with 4 additions and 3 deletions

View File

@ -81,7 +81,7 @@ pub fn rhs_matrix(op: &dyn SbpOperator2d, grid: &super::Grid) -> Implicit {
let a00 = if positive { let a00 = if positive {
&ky * &ky / (2.0 * &r) &ky * &ky / (2.0 * &r)
} else { } else {
-&ky * &ky / (2.0 * &r) -&ky * ky / (2.0 * &r)
}; };
let a00 = diagonal(a00.as_slice().unwrap()); let a00 = diagonal(a00.as_slice().unwrap());
let a01 = &ky / 2.0; let a01 = &ky / 2.0;
@ -98,7 +98,7 @@ pub fn rhs_matrix(op: &dyn SbpOperator2d, grid: &super::Grid) -> Implicit {
let a22 = if positive { let a22 = if positive {
&kx * &kx / (2.0 * &r) &kx * &kx / (2.0 * &r)
} else { } else {
-&kx * &kx / (2.0 * &r) -&kx * kx / (2.0 * &r)
}; };
let a22 = diagonal(a22.as_slice().unwrap()); 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 r = &kx * &kx + &ky * &ky;
let s00 = &ky * &ky / &r; let s00 = &ky * &ky / &r;
let s00 = diagonal(s00.as_slice().unwrap()); 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 s02 = diagonal(s02.as_slice().unwrap());
let s11 = diagonal(r.as_slice().unwrap()); let s11 = diagonal(r.as_slice().unwrap());
let s20 = &s02; let s20 = &s02;

View File

@ -286,6 +286,7 @@ impl System {
let mut res = [0.0; 3]; let mut res = [0.0; 3];
for j in 0..3 { for j in 0..3 {
#[allow(clippy::needless_range_loop)]
for i in 0..3 { for i in 0..3 {
res[j] += mat[j][i] * q[i]; res[j] += mat[j][i] * q[i];
} }