Skip to content

Commit

Permalink
refactor(math): remove unused From impl
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Gallo <riccardo.gallo@secomind.com>
  • Loading branch information
rgallor committed Nov 29, 2024
1 parent 18394e0 commit 55ebee7
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,6 @@ impl Display for MathFunction {
}
}

impl From<String> for MathFunction {
fn from(value: String) -> Self {
match value.as_str() {
"sin" => Self::Sin,
"noise-sin" => Self::NoiseSin,
"random-spikes-sin" => Self::RandomSpikesSin,
"const" => Self::Const,
"saw" => Self::Saw,
"rect" => Self::Rect,
"sinc" => Self::Sinc,
"random" => Self::Random,
_ => Self::Default,
}
}
}

impl MathFunction {
/// Use math functions to compute an output value given a certain input
pub fn compute(&self, value: f64) -> f64 {
Expand Down

0 comments on commit 55ebee7

Please sign in to comment.