Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Oct 26, 2024
1 parent 9bedd00 commit 7d80526
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ impl OpenSimplexNoise {
}

#[must_use]
#[allow(dead_code)] // FIXME: use expect
pub fn eval_3d<M: MathsCore>(&self, x: f64, y: f64, z: f64, wrap: f64) -> f64 {
OpenSimplexNoise3D::eval::<M>(Vec3::new(x, y, z), &self.perm, wrap)
}

#[must_use]
#[allow(dead_code)] // FIXME: use expect
pub fn eval_4d<M: MathsCore>(&self, x: f64, y: f64, z: f64, w: f64, wrap: f64) -> f64 {
OpenSimplexNoise4D::eval::<M>(Vec4::new(x, y, z, w), &self.perm, wrap)
}
Expand Down
1 change: 1 addition & 0 deletions rustcoalescence/src/args/config/rng/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ impl<M: MathsCore, G: RngCore<M>> From<G> for Base32RngState<M, G> {
}

impl<M: MathsCore, G: RngCore<M>> Base32RngState<M, G> {
#[allow(dead_code)] // FIXME: use expect
#[must_use]
pub fn into(self) -> G {
self.rng
Expand Down
19 changes: 12 additions & 7 deletions rustcoalescence/src/cli/simulate/parse/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ pub(in super::super) fn parse_and_normalise(
normalised_args: &mut BufferingSimulateArgsBuilder,
partitioning: &Partitioning,
) -> anyhow::Result<Algorithm> {
let SimulateArgsAlgorithmOnly { algorithm } =
let lint::SimulateArgsAlgorithmOnly { algorithm } =
try_parse_state("simulate", ron_args, &mut partitioning.get_size())?;

normalised_args.algorithm(&algorithm);

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,
}
}
1 change: 1 addition & 0 deletions rustcoalescence/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl<ReportSpeciation: Boolean, ReportDispersal: Boolean, ReportProgress: Boolea
impl<ReportSpeciation: Boolean, ReportDispersal: Boolean, ReportProgress: Boolean>
DynamicReporterContext<ReportSpeciation, ReportDispersal, ReportProgress>
{
#[allow(dead_code)] // FIXME: use expect
pub fn new(
reporter: ReporterPluginVec<ReportSpeciation, ReportDispersal, ReportProgress>,
) -> Self {
Expand Down

0 comments on commit 7d80526

Please sign in to comment.