mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 06:04:16 +00:00
Merge pull request #563 from RustAudio/clippy_warnings
This fixes all clippy warnings
This commit is contained in:
commit
e0b8e9bb57
6 changed files with 11 additions and 3 deletions
|
@ -107,7 +107,7 @@ where
|
|||
|
||||
// Load the next block.
|
||||
self.current_block_off = 0;
|
||||
let buffer = mem::replace(&mut self.current_block, Vec::new());
|
||||
let buffer = mem::take(&mut self.current_block);
|
||||
match self.reader.blocks().read_next_or_eof(buffer) {
|
||||
Ok(Some(block)) => {
|
||||
self.current_block_channel_len = (block.len() / block.channels()) as usize;
|
||||
|
|
|
@ -39,6 +39,9 @@ pub struct LoopedDecoder<R>(DecoderImpl<R>)
|
|||
where
|
||||
R: Read + Seek;
|
||||
|
||||
// can not really reduce the size of the VorbisDecoder. There are not any
|
||||
// arrays just a lot of struct fields.
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum DecoderImpl<R>
|
||||
where
|
||||
R: Read + Seek,
|
||||
|
|
|
@ -43,9 +43,12 @@ where
|
|||
|
||||
// TODO: consider reimplementing this with `from_factory`
|
||||
|
||||
type Sound<S> = Box<dyn Source<Item = S> + Send>;
|
||||
type SignalDone = Option<Sender<()>>;
|
||||
|
||||
/// The input of the queue.
|
||||
pub struct SourcesQueueInput<S> {
|
||||
next_sounds: Mutex<Vec<(Box<dyn Source<Item = S> + Send>, Option<Sender<()>>)>>,
|
||||
next_sounds: Mutex<Vec<(Sound<S>, SignalDone)>>,
|
||||
|
||||
// See constructor.
|
||||
keep_alive_if_empty: AtomicBool,
|
||||
|
|
|
@ -226,6 +226,7 @@ impl Sink {
|
|||
}
|
||||
|
||||
/// Returns the number of sounds currently in the queue.
|
||||
#[allow(clippy::len_without_is_empty)]
|
||||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
self.sound_count.load(Ordering::Relaxed)
|
||||
|
|
|
@ -17,7 +17,7 @@ impl SineWave {
|
|||
#[inline]
|
||||
pub fn new(freq: f32) -> SineWave {
|
||||
SineWave {
|
||||
freq: freq,
|
||||
freq,
|
||||
num_sample: 0,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,6 +168,7 @@ impl SpatialSink {
|
|||
}
|
||||
|
||||
/// Returns the number of sounds currently in the queue.
|
||||
#[allow(clippy::len_without_is_empty)]
|
||||
#[inline]
|
||||
pub fn len(&self) -> usize {
|
||||
self.sink.len()
|
||||
|
|
Loading…
Reference in a new issue