fix clippy lints

This commit is contained in:
Magnus Ulimoen 2019-09-03 19:57:41 +02:00
parent 0ee91f7850
commit 78ea65ebae
2 changed files with 3 additions and 5 deletions

View File

@ -104,8 +104,7 @@ impl System {
let ny = y.0.shape()[0]; let ny = y.0.shape()[0];
let nx = y.0.shape()[1]; let nx = y.0.shape()[1];
let h = SBP::h()[0] / (nx - 1) as f32; let hinv = 1.0 / (SBP::h()[0] / (nx - 1) as f32);
let hinv = 1.0 / h;
// East boundary // East boundary
for j in 0..ny { 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)); 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 / (SBP::h()[0] / (ny - 1) as f32);
let hinv = 1.0 / h;
// North boundary // North boundary
for j in 0..nx { for j in 0..nx {

View File

@ -69,7 +69,7 @@ impl Upwind4 {
} }
for i in 4..nx - 4 { 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; fut[(i)] += diff / dx;
} }
let last_elems = prev.slice(s!(nx - 7..)); let last_elems = prev.slice(s!(nx - 7..));