Skip to content

Commit

Permalink
fixed and/or disable hints/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
calbaker committed Jan 16, 2025
1 parent a990150 commit 607a6db
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fastsim-core/src/utils/interp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ pub trait InterpolatorMethods {
}

impl InterpolatorMethods for Interpolator {
#[allow(unused)]
fn set_min(&mut self, min: f64) -> anyhow::Result<()> {
let old_min = self.min()?;
match self {
Interpolator::Interp0D(value) => Ok(*value = min),
Interpolator::Interp0D(value) => {
*value = min;
Ok(())
}
Interpolator::Interp1D(interp) => {
todo!()
}
Expand All @@ -30,7 +34,10 @@ impl InterpolatorMethods for Interpolator {
fn set_max(&mut self, max: f64) -> anyhow::Result<()> {
let old_max = self.max()?;
match self {
Interpolator::Interp0D(value) => Ok(*value = max),
Interpolator::Interp0D(value) => {
*value = max;
Ok(())
}
Interpolator::Interp1D(interp) => {
Ok(interp.set_f_x(interp.f_x().iter().map(|x| x * max / old_max).collect())?)
}
Expand Down

0 comments on commit 607a6db

Please sign in to comment.