From 2d473b825558d4fe71da8aea7a8854c4684acdca Mon Sep 17 00:00:00 2001 From: Magnus Ulimoen Date: Mon, 16 Aug 2021 20:33:57 +0000 Subject: [PATCH] Clippy lints --- euler/src/eval.rs | 3 +++ euler/src/lib.rs | 1 + multigrid/src/eval.rs | 1 + multigrid/src/eval/evalexpr.rs | 2 ++ multigrid/src/main.rs | 4 ++-- multigrid/src/system.rs | 5 +++-- sbp/src/operators/algos.rs | 1 + utils/integrate/src/lib.rs | 2 +- 8 files changed, 14 insertions(+), 5 deletions(-) diff --git a/euler/src/eval.rs b/euler/src/eval.rs index 5e4c7cc..02344f6 100644 --- a/euler/src/eval.rs +++ b/euler/src/eval.rs @@ -5,6 +5,7 @@ use super::GAMMA; use ndarray::{azip, ArrayView, ArrayViewMut, Dimension}; pub trait Evaluator: Send + Sync { + #[allow(clippy::too_many_arguments)] fn evaluate( &self, t: Float, @@ -55,6 +56,7 @@ pub trait EvaluatorPressure: Send + Sync { rho: ArrayView, out: ArrayViewMut, ); + #[allow(clippy::too_many_arguments)] fn p( &self, t: Float, @@ -70,6 +72,7 @@ pub trait EvaluatorPressure: Send + Sync { impl<'a, D: Dimension, BP: EvaluatorPressure> Evaluator for EvaluatorPressureWrapper<'a, D, BP> { + #[allow(clippy::many_single_char_names)] fn evaluate( &self, t: Float, diff --git a/euler/src/lib.rs b/euler/src/lib.rs index 350cb5f..f712fb1 100644 --- a/euler/src/lib.rs +++ b/euler/src/lib.rs @@ -330,6 +330,7 @@ impl Field { let (rho, rhou, rhov, e) = self.components_mut(); vortex_param.evaluate(time, x, y, rho, rhou, rhov, e) } + #[allow(clippy::erasing_op, clippy::identity_op)] fn iter(&self) -> impl ExactSizeIterator + '_ { let n = self.nx() * self.ny(); let slice = self.0.as_slice().unwrap(); diff --git a/multigrid/src/eval.rs b/multigrid/src/eval.rs index 8b4b903..52c0857 100644 --- a/multigrid/src/eval.rs +++ b/multigrid/src/eval.rs @@ -10,6 +10,7 @@ pub enum Evaluator { } impl euler::eval::Evaluator for Evaluator { + #[allow(clippy::many_single_char_names)] fn evaluate( &self, t: Float, diff --git a/multigrid/src/eval/evalexpr.rs b/multigrid/src/eval/evalexpr.rs index e999252..ea50b71 100644 --- a/multigrid/src/eval/evalexpr.rs +++ b/multigrid/src/eval/evalexpr.rs @@ -79,6 +79,7 @@ pub struct EvaluatorConservation { } impl euler::eval::Evaluator for Evaluator { + #[allow(clippy::many_single_char_names)] fn evaluate( &self, t: Float, @@ -267,6 +268,7 @@ impl euler::eval::EvaluatorPressure for EvaluatorPressure { }) } + #[allow(clippy::many_single_char_names)] fn p( &self, t: Float, diff --git a/multigrid/src/main.rs b/multigrid/src/main.rs index 2f7a718..ad205fa 100644 --- a/multigrid/src/main.rs +++ b/multigrid/src/main.rs @@ -77,12 +77,12 @@ fn main() { } = config.into_runtime(); let basesystem = system::BaseSystem::new( - names.clone(), + names, grids, 0.0, operators, boundary_conditions, - initial_conditions.clone(), + initial_conditions, opt.output.clone(), ); // System::new(grids, grid_connections, operators); diff --git a/multigrid/src/system.rs b/multigrid/src/system.rs index cf92604..c698203 100644 --- a/multigrid/src/system.rs +++ b/multigrid/src/system.rs @@ -48,6 +48,7 @@ impl BaseSystem { output, } } + #[allow(clippy::many_single_char_names)] pub fn create(self) -> System { let fnow = self .grids @@ -134,7 +135,7 @@ impl BaseSystem { } } */ - parsing::InitialConditions::Vortex(vortexparams) => sys.vortex(0.0, &vortexparams), + parsing::InitialConditions::Vortex(vortexparams) => sys.vortex(0.0, vortexparams), parsing::InitialConditions::Expressions(expr) => { let t = 0.0; for (grid, field) in sys.grids.iter().zip(sys.fnow.iter_mut()) { @@ -413,7 +414,7 @@ impl integrate::Integrable for SingleThreadedSystem { impl SingleThreadedSystem { pub fn vortex(&mut self, t: Float, vortex_params: &euler::VortexParameters) { for (f, g) in self.fnow.iter_mut().zip(&self.grids) { - f.vortex(g.x(), g.y(), t, &vortex_params); + f.vortex(g.x(), g.y(), t, vortex_params); } } diff --git a/sbp/src/operators/algos.rs b/sbp/src/operators/algos.rs index 20ae1d5..74c351f 100644 --- a/sbp/src/operators/algos.rs +++ b/sbp/src/operators/algos.rs @@ -281,6 +281,7 @@ pub(crate) fn diff_op_2d_fallback( matrix: &BlockMatrix, optype: OperatorType, diff --git a/utils/integrate/src/lib.rs b/utils/integrate/src/lib.rs index 3785a77..d91afce 100644 --- a/utils/integrate/src/lib.rs +++ b/utils/integrate/src/lib.rs @@ -215,7 +215,7 @@ pub fn integrate( } }; - rhs(&mut k[i], &fut, simtime); + rhs(&mut k[i], fut, simtime); } }