remove dead code and use first() instead of [0]
@@ -711,7 +711,7 @@ impl App {
if let Some(spotify) = &self.spotify {
match spotify.current_user_saved_tracks_contains(&[track_id.clone()]) {
Ok(saved) => {
- if saved[0] {
+ if saved.first() == Some(&true) {
match spotify.current_user_saved_tracks_delete(&[track_id]) {
Ok(()) => {}
Err(e) => {
@@ -734,19 +734,6 @@ impl App {
};
}
- // Currently unused but keep for future changes
- #[allow(dead_code)]
- pub fn save_tracks(&mut self, track_ids: Vec<String>) {
- if let Some(spotify) = &self.spotify {
- match spotify.current_user_saved_tracks_add(&track_ids) {
- Ok(()) => {}
- Err(e) => {
- self.handle_error(e);
- }
- }
- };
- }
-
pub fn shuffle(&mut self) {
if let (Some(spotify), Some(context)) = (&self.spotify, &mut self.current_playback_context)
{
