diff options
author | Corey Richardson <corey@octayn.net> | 2017-09-24 09:18:26 -0400 |
---|---|---|
committer | Graham Northup <grahamnorthup@yahoo.com> | 2017-09-24 19:01:22 -0400 |
commit | 150d71cae770598ade7e09419150f1218e961128 (patch) | |
tree | a1b0848642fa59f746d9e4587e585a22df0188e2 /src/synth/sine.rs | |
parent | 5f1e73ab5bd0709dd408064c06f2717182777537 (diff) |
Fix more style things
All reported by clippy. Mostly stuff like unnecessary lifetimes
or references.
Diffstat (limited to 'src/synth/sine.rs')
-rw-r--r-- | src/synth/sine.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/synth/sine.rs b/src/synth/sine.rs index 918261c..66f29ef 100644 --- a/src/synth/sine.rs +++ b/src/synth/sine.rs @@ -22,7 +22,7 @@ impl Generator for Sine { self.phase = (self.phase + pvel * (self.buf.len() as f32)) % TAU; &self.buf } - fn buffer<'a>(&'a self) -> &'a SampleBuffer { &self.buf } + fn buffer(&self) -> &SampleBuffer { &self.buf } fn set_buffer(&mut self, buf: SampleBuffer) -> SampleBuffer { mem::replace(&mut self.buf, buf) } @@ -33,7 +33,7 @@ pub struct SineFactory; impl GeneratorFactory for SineFactory { fn new(&self, params: &mut FactoryParameters) -> Result<GenBox, GenFactoryError> { Ok(Box::new(Sine { - freq: params.remove_param("freq", 0)?.as_gen()?, + freq: params.remove_param("freq", 0)?.into_gen()?, phase: params.get_param("phase", 1, &ParamValue::Float(0.0)).as_f32()?, buf: SampleBuffer::new(params.env.default_buffer_size), })) |