From a26c2acc49a03b544d54a088b660618b5de9a64c Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Tue, 26 Dec 2017 14:02:25 +0200 Subject: Updated GTK version and fixed linting issues from Clippy --- benches/transforms.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'benches/transforms.rs') diff --git a/benches/transforms.rs b/benches/transforms.rs index a6be9fd..8771492 100644 --- a/benches/transforms.rs +++ b/benches/transforms.rs @@ -8,7 +8,7 @@ use bencher::Bencher; use std::f32::consts::PI; const SAMPLE_RATE: f32 = 44100.0; -const FRAMES: usize = 1024; +const FRAMES: u16 = 512; fn sin_arg(f: f32, t: f32, phase: f32) -> f32 { @@ -18,13 +18,13 @@ fn sin_arg(f: f32, t: f32, phase: f32) -> f32 { fn sample_sinusoud(amplitude: f32, frequency: f32, phase: f32) -> Vec { (0..FRAMES) .map(|x| { - let t = x as f32 / SAMPLE_RATE; + let t = f32::from(x) / SAMPLE_RATE; sin_arg(frequency, t, phase).sin() * amplitude }).collect() } fn bench_correlation_on_sine_wave(b: &mut Bencher) { - let frequency = 440.0 as f32; //concert A + let frequency = 440.0f32; //concert A let samples = sample_sinusoud(1.0, frequency, 0.0); b.iter(|| { -- cgit v1.2.3