Assignment instead of mem::repalce()

This commit is contained in:
Simon Persson 2018-02-24 10:50:48 +01:00
parent 1518459048
commit 8c3f587f30

View file

@ -177,7 +177,7 @@ impl PlayerState {
match mem::replace(self, Invalid) {
Playing { track_id, end_of_track, ..} => {
end_of_track.send(());
let old_state = mem::replace(self, EndOfTrack { track_id });
*self = EndOfTrack { track_id };
},
_ => panic!("Called playing_to_end_of_track in non-playing state.")
}