chore: Lint code
This commit is contained in:
parent
3887369735
commit
e2c7ba5d58
3 changed files with 7 additions and 11 deletions
|
|
@ -1 +0,0 @@
|
|||
nightly
|
||||
|
|
@ -64,9 +64,7 @@ impl Downloader {
|
|||
input: &str,
|
||||
) -> Result<Option<Vec<SearchResult>>, 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<SearchResult> = 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<Track, SpotifyError> {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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() {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue