From 66825cfceb599a854d41a9f05ed165213e17ead3 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Wed, 11 Mar 2020 08:04:30 -0500 Subject: reverses waveform and appends iterator directly --- src/audio.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/audio.rs') diff --git a/src/audio.rs b/src/audio.rs index ef92408..961c8ed 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -31,14 +31,14 @@ pub fn init() -> (StreamingSource, Vec) { _track_length += samples.len() as f32 / sample_channels; - samples = samples - .into_iter() - .enumerate() - .filter(|(i, _)| i % 2 == 0) - .map(|(_, s)| s) - .collect(); - - waveform.append(&mut samples); + waveform.append( + &mut samples + .into_iter() + .enumerate() + .filter(|(i, _)| i % 2 == 0) + .map(|(_, s)| s) + .collect(), + ); } (stream, waveform) -- cgit v1.2.3