mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Run cargo fmt
This commit is contained in:
parent
cdcb919c08
commit
e9c3357e41
4 changed files with 8 additions and 8 deletions
|
@ -337,7 +337,7 @@ impl Future for SpircTask {
|
||||||
error!("subscription terminated");
|
error!("subscription terminated");
|
||||||
self.shutdown = true;
|
self.shutdown = true;
|
||||||
self.commands.close();
|
self.commands.close();
|
||||||
},
|
}
|
||||||
Async::NotReady => (),
|
Async::NotReady => (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -296,7 +296,7 @@ where
|
||||||
warn!("Connection to server closed.");
|
warn!("Connection to server closed.");
|
||||||
session.shutdown();
|
session.shutdown();
|
||||||
return Ok(Async::Ready(()));
|
return Ok(Async::Ready(()));
|
||||||
},
|
}
|
||||||
Ok(Async::NotReady) => return Ok(Async::NotReady),
|
Ok(Async::NotReady) => return Ok(Async::NotReady),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
session.shutdown();
|
session.shutdown();
|
||||||
|
|
|
@ -636,13 +636,12 @@ impl PlayerInternal {
|
||||||
spotify_id: SpotifyId,
|
spotify_id: SpotifyId,
|
||||||
position: i64,
|
position: i64,
|
||||||
) -> Option<(Decoder, f32, StreamLoaderController, usize)> {
|
) -> Option<(Decoder, f32, StreamLoaderController, usize)> {
|
||||||
|
|
||||||
let audio = match AudioItem::get_audio_item(&self.session, spotify_id).wait() {
|
let audio = match AudioItem::get_audio_item(&self.session, spotify_id).wait() {
|
||||||
Ok(audio) => audio,
|
Ok(audio) => audio,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
error!("Unable to load audio item.");
|
error!("Unable to load audio item.");
|
||||||
return None
|
return None;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
info!("Loading <{}> with Spotify URI <{}>", audio.name, audio.uri);
|
info!("Loading <{}> with Spotify URI <{}>", audio.name, audio.uri);
|
||||||
|
|
|
@ -8,10 +8,10 @@ use std::mem;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use std::time::Instant;
|
||||||
use tokio_core::reactor::{Core, Handle};
|
use tokio_core::reactor::{Core, Handle};
|
||||||
use tokio_io::IoStream;
|
use tokio_io::IoStream;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
use librespot::core::authentication::{get_credentials, Credentials};
|
use librespot::core::authentication::{get_credentials, Credentials};
|
||||||
use librespot::core::cache::Cache;
|
use librespot::core::cache::Cache;
|
||||||
|
@ -513,7 +513,9 @@ impl Future for Main {
|
||||||
}
|
}
|
||||||
if drop_spirc_and_try_to_reconnect {
|
if drop_spirc_and_try_to_reconnect {
|
||||||
self.spirc_task = None;
|
self.spirc_task = None;
|
||||||
while (!self.auto_connect_times.is_empty()) && ((Instant::now() - self.auto_connect_times[0]).as_secs() > 600) {
|
while (!self.auto_connect_times.is_empty())
|
||||||
|
&& ((Instant::now() - self.auto_connect_times[0]).as_secs() > 600)
|
||||||
|
{
|
||||||
let _ = self.auto_connect_times.remove(0);
|
let _ = self.auto_connect_times.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,7 +529,6 @@ impl Future for Main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if let Some(ref mut player_event_channel) = self.player_event_channel {
|
if let Some(ref mut player_event_channel) = self.player_event_channel {
|
||||||
if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() {
|
if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() {
|
||||||
if let Some(ref program) = self.player_event_program {
|
if let Some(ref program) = self.player_event_program {
|
||||||
|
|
Loading…
Reference in a new issue