diff --git a/src/album.rs b/src/album.rs index 3114a47..f864cde 100644 --- a/src/album.rs +++ b/src/album.rs @@ -150,7 +150,7 @@ impl ListItem for Album { } } - fn as_listitem(&self) -> Box { + fn as_listitem(&self) -> Box { Box::new(self.clone()) } diff --git a/src/artist.rs b/src/artist.rs index ea0d9c7..1d7acb9 100644 --- a/src/artist.rs +++ b/src/artist.rs @@ -139,7 +139,7 @@ impl ListItem for Artist { } } - fn as_listitem(&self) -> Box { + fn as_listitem(&self) -> Box { Box::new(self.clone()) } diff --git a/src/mpris.rs b/src/mpris.rs index eee23f6..2deab91 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -12,7 +12,7 @@ use queue::{Queue, RepeatSetting}; use spotify::{PlayerEvent, Spotify}; use track::Track; -type Metadata = HashMap>>; +type Metadata = HashMap>>; struct MprisState(String, Option); fn get_playbackstatus(spotify: Arc) -> String { @@ -192,7 +192,7 @@ fn run_dbus_server(spotify: Arc, queue: Arc, rx: mpsc::Receiver< let property_metadata = { let queue = queue.clone(); - f.property::>>, _>("Metadata", ()) + f.property::>>, _>("Metadata", ()) .access(Access::Read) .on_get(move |iter, _| { let hm = get_metadata(queue.clone().get_current()); @@ -401,7 +401,10 @@ fn run_dbus_server(spotify: Arc, queue: Arc, rx: mpsc::Receiver< if let Ok(state) = rx.try_recv() { let mut changed: PropertiesPropertiesChanged = Default::default(); - debug!("mpris PropertiesChanged: status {}, track: {:?}", state.0, state.1); + debug!( + "mpris PropertiesChanged: status {}, track: {:?}", + state.0, state.1 + ); changed.interface_name = "org.mpris.MediaPlayer2.Player".to_string(); changed.changed_properties.insert( @@ -409,15 +412,14 @@ fn run_dbus_server(spotify: Arc, queue: Arc, rx: mpsc::Receiver< Variant(Box::new(get_metadata(state.1))), ); - changed.changed_properties.insert( - "PlaybackStatus".to_string(), - Variant(Box::new(state.0)), - ); + changed + .changed_properties + .insert("PlaybackStatus".to_string(), Variant(Box::new(state.0))); conn.send( changed.to_emit_message(&Path::new("/org/mpris/MediaPlayer2".to_string()).unwrap()), ) - .unwrap(); + .unwrap(); } } } @@ -426,7 +428,7 @@ fn run_dbus_server(spotify: Arc, queue: Arc, rx: mpsc::Receiver< pub struct MprisManager { tx: mpsc::Sender, queue: Arc, - spotify: Arc + spotify: Arc, } impl MprisManager { diff --git a/src/playlist.rs b/src/playlist.rs index c8fe079..8f9ec33 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -107,7 +107,7 @@ impl ListItem for Playlist { } } - fn as_listitem(&self) -> Box { + fn as_listitem(&self) -> Box { Box::new(self.clone()) } diff --git a/src/spotify.rs b/src/spotify.rs index ace9d07..5c7ff1c 100644 --- a/src/spotify.rs +++ b/src/spotify.rs @@ -75,9 +75,9 @@ struct Worker { commands: mpsc::UnboundedReceiver, session: Session, player: Player, - play_task: Box>, - refresh_task: Box>, - token_task: Box>, + play_task: Box>, + refresh_task: Box>, + token_task: Box>, active: bool, } @@ -102,7 +102,7 @@ impl Worker { } impl Worker { - fn create_refresh(&self) -> Box> { + fn create_refresh(&self) -> Box> { let ev = self.events.clone(); let future = tokio_timer::Interval::new_interval(Duration::from_millis(400)).map(move |_| { @@ -185,8 +185,8 @@ impl futures::Future for Worker { } Err(e) => { error!("could not generate token: {:?}", e); - }, - _ => () + } + _ => (), } if !progress { @@ -256,7 +256,7 @@ impl Spotify { fn get_token( session: &Session, sender: oneshot::Sender, - ) -> Box> { + ) -> Box> { let client_id = config::CLIENT_ID; let scopes = "user-read-private,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played"; let url = format!( diff --git a/src/track.rs b/src/track.rs index d1d262a..79d3b9f 100644 --- a/src/track.rs +++ b/src/track.rs @@ -151,7 +151,7 @@ impl ListItem for Track { current.map(|t| t.id == self.id).unwrap_or(false) } - fn as_listitem(&self) -> Box { + fn as_listitem(&self) -> Box { Box::new(self.clone()) } diff --git a/src/traits.rs b/src/traits.rs index 49861be..a13fbaf 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -31,7 +31,7 @@ pub trait ListItem: Sync + Send + 'static { None } - fn as_listitem(&self) -> Box; + fn as_listitem(&self) -> Box; } pub trait ViewExt: View { diff --git a/src/ui/contextmenu.rs b/src/ui/contextmenu.rs index c3568be..01a1d36 100644 --- a/src/ui/contextmenu.rs +++ b/src/ui/contextmenu.rs @@ -17,12 +17,12 @@ pub struct ContextMenu { } enum ContextMenuAction { - ShowItem(Box), + ShowItem(Box), ShareUrl(String), } impl ContextMenu { - pub fn new(item: &Box, queue: Arc, library: Arc) -> Self { + pub fn new(item: &Box, queue: Arc, library: Arc) -> Self { let mut content: SelectView = SelectView::new().autojump(); if let Some(a) = item.artist() { content.add_item("Show artist", ContextMenuAction::ShowItem(Box::new(a))); diff --git a/src/ui/listview.rs b/src/ui/listview.rs index 9bdb72d..4e2e78e 100644 --- a/src/ui/listview.rs +++ b/src/ui/listview.rs @@ -21,7 +21,7 @@ use ui::album::AlbumView; use ui::artist::ArtistView; use ui::contextmenu::ContextMenu; -pub type Paginator = Box>>) + Send + Sync>; +pub type Paginator = Box>>) + Send + Sync>; pub struct Pagination { max_content: Arc>>, callback: Arc>>>, diff --git a/src/ui/search.rs b/src/ui/search.rs index e790783..f14f055 100644 --- a/src/ui/search.rs +++ b/src/ui/search.rs @@ -40,7 +40,7 @@ pub struct SearchView { } type SearchHandler = - Box, &Arc>>, &str, usize, bool) -> u32 + Send + Sync>; + Box, &Arc>>, &str, usize, bool) -> u32 + Send + Sync>; pub const LIST_ID: &str = "search_list"; pub const EDIT_ID: &str = "search_edit";