diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index bf867e0..0000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly diff --git a/src/downloader.rs b/src/downloader.rs index ecf787c..f2772de 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -64,9 +64,7 @@ impl Downloader { input: &str, ) -> Result>, SpotifyError> { if let Ok(uri) = Spotify::parse_uri(input) { - if let Err(e) = self.add_uri(&uri).await { - return Err(e); - } + self.add_uri(&uri).await?; Ok(None) } else { let results: Vec = self @@ -301,7 +299,7 @@ impl DownloaderInternal { ( "%artist%", sanitize( - &track + track .artists .iter() .map(|a| a.name.as_str()) @@ -313,7 +311,7 @@ impl DownloaderInternal { ( "%artists%", sanitize( - &track + track .artists .iter() .map(|a| a.name.as_str()) @@ -330,7 +328,7 @@ impl DownloaderInternal { ( "%albumArtist%", sanitize( - &track + track .album .artists .iter() @@ -343,7 +341,7 @@ impl DownloaderInternal { ( "%albumArtists%", sanitize( - &track + track .album .artists .iter() @@ -475,13 +473,13 @@ impl DownloaderInternal { async fn find_alternative(session: &Session, track: Track) -> Result { for alt in track.alternatives { - let t = Track::get(&session, alt).await?; + let t = Track::get(session, alt).await?; if !t.available { return Ok(t); } } - return Err(SpotifyError::Unavailable); + Err(SpotifyError::Unavailable) } /// Download track by id diff --git a/src/main.rs b/src/main.rs index 0746569..7393d5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,6 @@ async fn main() { #[tokio::main] async fn main() { use colored::control; - use std::os::windows::process; //backwards compatibility. if control::set_virtual_terminal(true).is_ok() {};