From 7d8052644ff5d482fabad7e6f8b60b32358e6a5d Mon Sep 17 00:00:00 2001 From: Juniper Tyree Date: Sat, 26 Oct 2024 17:20:11 +0000 Subject: [PATCH] Fix clippy lints --- .../wrapping_noise/opensimplex_noise/mod.rs | 2 ++ rustcoalescence/src/args/config/rng/mod.rs | 1 + .../src/cli/simulate/parse/algorithm.rs | 19 ++++++++++++------- rustcoalescence/src/reporter.rs | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs index 62b50c7ca..a21c6ac88 100644 --- a/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs +++ b/necsim/impls/no-std/src/cogs/habitat/wrapping_noise/opensimplex_noise/mod.rs @@ -53,11 +53,13 @@ impl OpenSimplexNoise { } #[must_use] + #[allow(dead_code)] // FIXME: use expect pub fn eval_3d(&self, x: f64, y: f64, z: f64, wrap: f64) -> f64 { OpenSimplexNoise3D::eval::(Vec3::new(x, y, z), &self.perm, wrap) } #[must_use] + #[allow(dead_code)] // FIXME: use expect pub fn eval_4d(&self, x: f64, y: f64, z: f64, w: f64, wrap: f64) -> f64 { OpenSimplexNoise4D::eval::(Vec4::new(x, y, z, w), &self.perm, wrap) } diff --git a/rustcoalescence/src/args/config/rng/mod.rs b/rustcoalescence/src/args/config/rng/mod.rs index 284c66a2e..13e20d068 100644 --- a/rustcoalescence/src/args/config/rng/mod.rs +++ b/rustcoalescence/src/args/config/rng/mod.rs @@ -82,6 +82,7 @@ impl> From for Base32RngState { } impl> Base32RngState { + #[allow(dead_code)] // FIXME: use expect #[must_use] pub fn into(self) -> G { self.rng diff --git a/rustcoalescence/src/cli/simulate/parse/algorithm.rs b/rustcoalescence/src/cli/simulate/parse/algorithm.rs index ec647e02c..47193c802 100644 --- a/rustcoalescence/src/cli/simulate/parse/algorithm.rs +++ b/rustcoalescence/src/cli/simulate/parse/algorithm.rs @@ -12,7 +12,7 @@ pub(in super::super) fn parse_and_normalise( normalised_args: &mut BufferingSimulateArgsBuilder, partitioning: &Partitioning, ) -> anyhow::Result { - let SimulateArgsAlgorithmOnly { algorithm } = + let lint::SimulateArgsAlgorithmOnly { algorithm } = try_parse_state("simulate", ron_args, &mut partitioning.get_size())?; normalised_args.algorithm(&algorithm); @@ -20,10 +20,15 @@ pub(in super::super) fn parse_and_normalise( Ok(algorithm) } -#[derive(DeserializeState)] -#[serde(deserialize_state = "PartitionSize")] -#[serde(rename = "Simulate")] -struct SimulateArgsAlgorithmOnly { - #[serde(deserialize_state)] - algorithm: Algorithm, +#[allow(unreachable_patterns)] // FIXME: use expect +mod lint { + use super::{Algorithm, PartitionSize}; + + #[derive(DeserializeState)] + #[serde(deserialize_state = "PartitionSize")] + #[serde(rename = "Simulate")] + pub struct SimulateArgsAlgorithmOnly { + #[serde(deserialize_state)] + pub algorithm: Algorithm, + } } diff --git a/rustcoalescence/src/reporter.rs b/rustcoalescence/src/reporter.rs index 818df4c9c..fe2011105 100644 --- a/rustcoalescence/src/reporter.rs +++ b/rustcoalescence/src/reporter.rs @@ -27,6 +27,7 @@ impl DynamicReporterContext { + #[allow(dead_code)] // FIXME: use expect pub fn new( reporter: ReporterPluginVec, ) -> Self {