From 150d71cae770598ade7e09419150f1218e961128 Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Sun, 24 Sep 2017 09:18:26 -0400 Subject: Fix more style things All reported by clippy. Mostly stuff like unnecessary lifetimes or references. --- src/synth/logic.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/synth/logic.rs') diff --git a/src/synth/logic.rs b/src/synth/logic.rs index 672cc78..d5f9401 100644 --- a/src/synth/logic.rs +++ b/src/synth/logic.rs @@ -57,7 +57,7 @@ impl Generator for IfElse { &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) } @@ -67,9 +67,9 @@ pub struct IfElseFactory; impl GeneratorFactory for IfElseFactory { fn new(&self, params: &mut FactoryParameters) -> Result { - let cond = params.remove_param("cond", 0)?.as_gen()?; - let iftrue = params.remove_param("iftrue", 1)?.as_gen()?; - let iffalse = params.remove_param("iffalse", 2)?.as_gen()?; + let cond = params.remove_param("cond", 0)?.into_gen()?; + let iftrue = params.remove_param("iftrue", 1)?.into_gen()?; + let iffalse = params.remove_param("iffalse", 2)?.into_gen()?; let buf = SampleBuffer::new(cmp::max(cmp::max(cond.buffer().len(), iftrue.buffer().len()), iffalse.buffer().len())); Ok(Box::new(IfElse { cond: cond, iftrue: iftrue, iffalse: iffalse, buf: buf })) } -- cgit v1.2.3-70-g09d2