fix github-advanced-security comments

This commit is contained in:
Guillem Castro 2024-05-17 17:57:35 +02:00
parent 60a04f18d6
commit 2dc99e884b
2 changed files with 2 additions and 3 deletions

View file

@ -65,7 +65,7 @@ impl Downloader {
) -> Result<()> {
futures::stream::iter(tracks)
.map(|track| {
self.download_track(track, &options)
self.download_track(track, options)
})
.buffer_unordered(options.parallel)
.try_collect::<Vec<_>>()

View file

@ -46,8 +46,7 @@ impl Encoder for Mp3Encoder {
move || {
let samples: Vec<i16> = samples.samples.iter().map(|&x| x as i16).collect();
let input = InterleavedPcm(samples.as_slice());
let mut mp3_out_buffer = Vec::new();
mp3_out_buffer.reserve(mp3lame_encoder::max_required_buffer_size(samples.len()));
let mut mp3_out_buffer = Vec::with_capacity(mp3lame_encoder::max_required_buffer_size(samples.len()));
let encoded_size = mp3_encoder
.encode(input, mp3_out_buffer.spare_capacity_mut())
.map_err(|e| anyhow!("Failed to encode mp3: {}", e))?;