From 78ea65ebaeae0c26e7e5f04d235d20e9d9b73b59 Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Tue, 3 Sep 2019 19:57:41 +0200 Subject: [PATCH] fix clippy lints --- src/maxwell.rs | 6 ++---- src/operators/upwind4.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/maxwell.rs b/src/maxwell.rs index 3cb4313..d125976 100644 --- a/src/maxwell.rs +++ b/src/maxwell.rs @@ -104,8 +104,7 @@ impl System { let ny = y.0.shape()[0]; let nx = y.0.shape()[1]; - let h = SBP::h()[0] / (nx - 1) as f32; - let hinv = 1.0 / h; + let hinv = 1.0 / (SBP::h()[0] / (nx - 1) as f32); // East boundary for j in 0..ny { @@ -130,8 +129,7 @@ impl System { k[i].2[(j, 0)] += tau * hinv * (-0.5 * (v.1 - g.1) - 0.5 * (v.2 - g.2)); } - let h = SBP::h()[0] / (ny - 1) as f32; - let hinv = 1.0 / h; + let hinv = 1.0 / (SBP::h()[0] / (ny - 1) as f32); // North boundary for j in 0..nx { diff --git a/src/operators/upwind4.rs b/src/operators/upwind4.rs index 760ad3c..2290cd3 100644 --- a/src/operators/upwind4.rs +++ b/src/operators/upwind4.rs @@ -69,7 +69,7 @@ impl Upwind4 { } for i in 4..nx - 4 { - let diff = diag.dot(&prev.slice(s!(i - 3..i + 3 + 1))); + let diff = diag.dot(&prev.slice(s!(i - 3..=i + 3))); fut[(i)] += diff / dx; } let last_elems = prev.slice(s!(nx - 7..));