From ed555346fa785927b8fbe9bb190f9e11689b6ae3 Mon Sep 17 00:00:00 2001 From: Jackson Goode Date: Wed, 7 Feb 2024 14:19:31 -0800 Subject: [PATCH] Linting --- psst-gui/src/controller/playback.rs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/psst-gui/src/controller/playback.rs b/psst-gui/src/controller/playback.rs index a7bf4250..d6268a23 100644 --- a/psst-gui/src/controller/playback.rs +++ b/psst-gui/src/controller/playback.rs @@ -414,27 +414,22 @@ where Event::KeyDown(key) if key.code == Code::ArrowRight => { if key.mods.shift() { self.next(); - } else { - if let Some(now_playing) = &data.playback.now_playing { - let current_position = now_playing.progress; - let max_position = now_playing.item.duration(); - let seek_position = - (current_position + Duration::from_secs(10)).min(max_position); - self.seek(seek_position); - } + } else if let Some(now_playing) = &data.playback.now_playing { + let current_position = now_playing.progress; + let max_position = now_playing.item.duration(); + let seek_position = + (current_position + Duration::from_secs(10)).min(max_position); + self.seek(seek_position); } ctx.set_handled(); } Event::KeyDown(key) if key.code == Code::ArrowLeft => { if key.mods.shift() { self.previous(); - } else { - if let Some(now_playing) = &data.playback.now_playing { - let current_position = now_playing.progress; - let seek_position = - current_position.saturating_sub(Duration::from_secs(10)); - self.seek(seek_position); - } + } else if let Some(now_playing) = &data.playback.now_playing { + let current_position = now_playing.progress; + let seek_position = current_position.saturating_sub(Duration::from_secs(10)); + self.seek(seek_position); } ctx.set_handled(); }