mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 06:04:16 +00:00
refactor: remove unnecessary clone()
calls (#550)
This commit is contained in:
parent
698ca2d5c2
commit
77c5c5485c
2 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ impl SymphoniaDecoder {
|
|||
#[inline]
|
||||
fn get_buffer(decoded: AudioBufferRef, spec: &SignalSpec) -> SampleBuffer<i16> {
|
||||
let duration = units::Duration::from(decoded.capacity() as u64);
|
||||
let mut buffer = SampleBuffer::<i16>::new(duration, spec.clone());
|
||||
let mut buffer = SampleBuffer::<i16>::new(duration, *spec);
|
||||
buffer.copy_interleaved_ref(decoded);
|
||||
buffer
|
||||
}
|
||||
|
|
|
@ -349,9 +349,9 @@ fn supported_output_formats(
|
|||
Ok(supported.into_iter().flat_map(|sf| {
|
||||
let max_rate = sf.max_sample_rate();
|
||||
let min_rate = sf.min_sample_rate();
|
||||
let mut formats = vec![sf.clone().with_max_sample_rate()];
|
||||
let mut formats = vec![sf.with_max_sample_rate()];
|
||||
if HZ_44100 < max_rate && HZ_44100 > min_rate {
|
||||
formats.push(sf.clone().with_sample_rate(HZ_44100))
|
||||
formats.push(sf.with_sample_rate(HZ_44100))
|
||||
}
|
||||
formats.push(sf.with_sample_rate(min_rate));
|
||||
formats
|
||||
|
|
Loading…
Reference in a new issue