mirror of
https://github.com/GuillemCastro/spotify-dl.git
synced 2024-11-23 10:50:24 +01:00
fix github-advanced-security comments
This commit is contained in:
parent
60a04f18d6
commit
2dc99e884b
2 changed files with 2 additions and 3 deletions
|
@ -65,7 +65,7 @@ impl Downloader {
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
futures::stream::iter(tracks)
|
futures::stream::iter(tracks)
|
||||||
.map(|track| {
|
.map(|track| {
|
||||||
self.download_track(track, &options)
|
self.download_track(track, options)
|
||||||
})
|
})
|
||||||
.buffer_unordered(options.parallel)
|
.buffer_unordered(options.parallel)
|
||||||
.try_collect::<Vec<_>>()
|
.try_collect::<Vec<_>>()
|
||||||
|
|
|
@ -46,8 +46,7 @@ impl Encoder for Mp3Encoder {
|
||||||
move || {
|
move || {
|
||||||
let samples: Vec<i16> = samples.samples.iter().map(|&x| x as i16).collect();
|
let samples: Vec<i16> = samples.samples.iter().map(|&x| x as i16).collect();
|
||||||
let input = InterleavedPcm(samples.as_slice());
|
let input = InterleavedPcm(samples.as_slice());
|
||||||
let mut mp3_out_buffer = Vec::new();
|
let mut mp3_out_buffer = Vec::with_capacity(mp3lame_encoder::max_required_buffer_size(samples.len()));
|
||||||
mp3_out_buffer.reserve(mp3lame_encoder::max_required_buffer_size(samples.len()));
|
|
||||||
let encoded_size = mp3_encoder
|
let encoded_size = mp3_encoder
|
||||||
.encode(input, mp3_out_buffer.spare_capacity_mut())
|
.encode(input, mp3_out_buffer.spare_capacity_mut())
|
||||||
.map_err(|e| anyhow!("Failed to encode mp3: {}", e))?;
|
.map_err(|e| anyhow!("Failed to encode mp3: {}", e))?;
|
||||||
|
|
Loading…
Reference in a new issue