From 8c3f587f307faa34cac34f22842b78378aab0ba1 Mon Sep 17 00:00:00 2001 From: Simon Persson Date: Sat, 24 Feb 2018 10:50:48 +0100 Subject: [PATCH] Assignment instead of mem::repalce() --- playback/src/player.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index afd79a58..7fdf416e 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -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.") }