Skip to content

Commit 75a0318

Browse files
removed redundunt cloning
1 parent 8c746b6 commit 75a0318

File tree

1 file changed

+2
-5
lines changed
  • src/host/coreaudio/macos

1 file changed

+2
-5
lines changed

src/host/coreaudio/macos/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,10 @@ impl Device {
299299
});
300300
Ok(res.collect::<Vec<_>>().into_iter())
301301
} else {
302-
let values = ranges.into_iter().map(|v| v.mMinimum as u32); //assume that all mMinimum and mMaximum values are the same
303-
let min = values.clone().min().expect("the list must not be empty");
304-
let max = values.max().expect("the list must not be empty");
305302
let fmt = SupportedStreamConfigRange {
306303
channels: n_channels as ChannelCount,
307-
min_sample_rate: SampleRate(min),
308-
max_sample_rate: SampleRate(max),
304+
min_sample_rate: SampleRate(ranges.into_iter().map(|v| v.mMinimum as u32).min().expect("the list must not be empty")),
305+
max_sample_rate: SampleRate(ranges.into_iter().map(|v| v.mMaximum as u32).max().expect("the list must not be empty")),
309306
buffer_size,
310307
sample_format,
311308
};

0 commit comments

Comments
 (0)