Replace all .filter.map chains with .filter_map

This commit is contained in:
Qluxzz
2021-03-15 23:57:42 +01:00
committed by Henrik Friedrichsen
parent c5e6c2c79a
commit 46899ace8b
6 changed files with 18 additions and 60 deletions

View File

@@ -594,11 +594,7 @@ impl Spotify {
pub fn overwrite_playlist(&self, id: &str, tracks: &[Playable]) {
// extract only track IDs
let mut tracks: Vec<String> = tracks
.iter()
.filter(|track| track.id().is_some())
.map(|track| track.id().unwrap())
.collect();
let mut tracks: Vec<String> = tracks.iter().filter_map(|track| track.id()).collect();
// we can only send 100 tracks per request
let mut remainder = if tracks.len() > 100 {