diff --git a/src/ui/window.rs b/src/ui/window.rs index 0523251..510b031 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -518,18 +518,16 @@ mod imp { } fn song(&self) -> Option { - if self.obj().playlist_pos() < 0 { - None - } else { - let song: Song = self - .obj() - .playlist_model() - .item(self.obj().playlist_pos() as u32) - .unwrap() - .dynamic_cast() - .unwrap(); - - Some(song) + match self.obj().playlist_pos() { + playlist_pos if playlist_pos < 0 => None, + playlist_pos => Some( + self.obj() + .playlist_model() + .item(playlist_pos as u32) + .unwrap() + .dynamic_cast() + .unwrap(), + ), } }