cargo fmt

This commit is contained in:
Henrik Friedrichsen
2019-03-02 18:39:58 +01:00
parent 5a1c7dff69
commit c60324af61
2 changed files with 13 additions and 6 deletions

View File

@@ -39,6 +39,8 @@ impl EventManager {
pub fn trigger(&self) {
// send a no-op to trigger event loop processing
self.cursive_sink.send(Box::new(|_s: &mut Cursive| {})).expect("could not send no-op event to cursive");
self.cursive_sink
.send(Box::new(|_s: &mut Cursive| {}))
.expect("could not send no-op event to cursive");
}
}

View File

@@ -96,7 +96,7 @@ impl futures::Future for Worker {
WorkerCommand::Play => {
self.player.play();
self.events.send(Event::PlayState(PlayerState::Playing));
},
}
WorkerCommand::Pause => {
self.player.pause();
self.events.send(Event::PlayState(PlayerState::Paused));
@@ -121,8 +121,7 @@ impl futures::Future for Worker {
self.player.play();
self.events.send(Event::PlayState(PlayerState::Playing));
}
else {
} else {
self.events.send(Event::PlayState(PlayerState::Stopped));
}
}
@@ -232,7 +231,10 @@ impl Spotify {
}
pub fn updatestate(&self, newstate: PlayerState) {
let mut state = self.state.write().expect("could not acquire write lock on player state");
let mut state = self
.state
.write()
.expect("could not acquire write lock on player state");
*state = newstate;
}
@@ -242,7 +244,10 @@ impl Spotify {
}
pub fn toggleplayback(&self) {
let state = self.state.read().expect("could not acquire read lock on player state");
let state = self
.state
.read()
.expect("could not acquire read lock on player state");
match *state {
PlayerState::Playing => self.pause(),
PlayerState::Paused => self.play(),