mirror of
https://github.com/RustAudio/rodio
synced 2024-12-13 21:52:38 +00:00
Fix all warnings
This commit is contained in:
parent
e8d7a42db4
commit
f339184d75
8 changed files with 5 additions and 51 deletions
|
@ -1,38 +0,0 @@
|
|||
use conversions::Sample;
|
||||
|
||||
pub struct AmplifierIterator<I> where I: Iterator {
|
||||
input: I,
|
||||
amplication: f32,
|
||||
}
|
||||
|
||||
impl<I> AmplifierIterator<I> where I: Iterator {
|
||||
#[inline]
|
||||
pub fn new(input: I, amplication: f32) -> AmplifierIterator<I> {
|
||||
AmplifierIterator {
|
||||
input: input,
|
||||
amplication: amplication,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_amplification(&mut self, new_value: f32) {
|
||||
self.amplication = new_value;
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> Iterator for AmplifierIterator<I> where I: Iterator, I::Item: Sample {
|
||||
type Item = I::Item;
|
||||
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<I::Item> {
|
||||
self.input.next().map(|value| value.amplify(self.amplication))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
self.input.size_hint()
|
||||
}
|
||||
}
|
||||
|
||||
impl<I> ExactSizeIterator for AmplifierIterator<I>
|
||||
where I: ExactSizeIterator, I::Item: Sample {}
|
|
@ -8,9 +8,7 @@ pub use self::sample::Sample;
|
|||
pub use self::sample::DataConverter;
|
||||
pub use self::channels::ChannelsCountConverter;
|
||||
pub use self::samples_rate::SamplesRateConverter;
|
||||
pub use self::amplifier::AmplifierIterator;
|
||||
|
||||
mod amplifier;
|
||||
mod channels;
|
||||
mod sample;
|
||||
mod samples_rate;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use cpal;
|
||||
use conversions::Sample;
|
||||
|
||||
use std::iter;
|
||||
use std::mem;
|
||||
|
||||
/// Iterator that converts from a certain samples rate to another.
|
||||
|
@ -61,8 +60,8 @@ impl<I> SamplesRateConverter<I> where I: Iterator, I::Item: Sample {
|
|||
debug_assert_eq!(from, gcd);
|
||||
(Vec::new(), Vec::new())
|
||||
} else {
|
||||
let mut first = input.by_ref().take(num_channels as usize).collect::<Vec<_>>();
|
||||
let mut next = input.by_ref().take(num_channels as usize).collect::<Vec<_>>();
|
||||
let first = input.by_ref().take(num_channels as usize).collect::<Vec<_>>();
|
||||
let next = input.by_ref().take(num_channels as usize).collect::<Vec<_>>();
|
||||
(first, next)
|
||||
};
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@ use std::io::{Read, Seek};
|
|||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use cpal::Endpoint;
|
||||
|
||||
mod vorbis;
|
||||
mod wav;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use std::io::{Read, Seek};
|
||||
use std::f64::INFINITY;
|
||||
use super::Decoder;
|
||||
use conversions;
|
||||
|
||||
use cpal::{self, Endpoint, Voice};
|
||||
use cpal;
|
||||
use vorbis;
|
||||
|
||||
pub struct VorbisDecoder {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use std::io::{Read, Seek, SeekFrom};
|
||||
use std::cmp;
|
||||
use super::Decoder;
|
||||
use conversions;
|
||||
|
||||
use cpal::{self, Endpoint, Voice};
|
||||
use cpal;
|
||||
use hound::WavReader;
|
||||
|
||||
pub struct WavDecoder {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::cmp;
|
||||
use std::mem;
|
||||
use std::collections::HashMap;
|
||||
use std::io::{Read, Seek};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![cfg_attr(test, deny(missing_docs))]
|
||||
//#![cfg_attr(test, deny(warnings))]
|
||||
#![cfg_attr(test, deny(warnings))]
|
||||
|
||||
extern crate cpal;
|
||||
extern crate hound;
|
||||
|
|
Loading…
Reference in a new issue