diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2017-12-26 14:02:25 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2017-12-26 14:02:25 +0200 |
commit | a26c2acc49a03b544d54a088b660618b5de9a64c (patch) | |
tree | 037aa1fe8145842632ea4836254877b85ae08fde /benches/transforms.rs | |
parent | bbce5d68e2a6007fc8b023bf694ec058373b718c (diff) |
Updated GTK version and fixed linting issues from Clippy
Diffstat (limited to 'benches/transforms.rs')
-rw-r--r-- | benches/transforms.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<f32> { (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(|| { |