about summary refs log tree commit diff stats
path: root/src/select/cmds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/cmds.rs')
-rw-r--r--src/select/cmds.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/select/cmds.rs b/src/select/cmds.rs
index 2b36fe8..31589f2 100644
--- a/src/select/cmds.rs
+++ b/src/select/cmds.rs
@@ -36,10 +36,10 @@ pub async fn handle_select_cmd(
             handle_status_change(app, shared, line_number, VideoStatus::Watched).await?;
         }
         SelectCommand::Watch { shared } => {
-            let hash = shared.hash.clone().realize(&app).await?;
+            let hash = shared.hash.clone().realize(app).await?;
 
             let video = get_video_by_hash(app, &hash).await?;
-            if let Some(_) = video.cache_path {
+            if video.cache_path.is_some() {
                 handle_status_change(app, shared, line_number, VideoStatus::Cached).await?;
             } else {
                 handle_status_change(app, shared, line_number, VideoStatus::Watch).await?;
@@ -63,7 +63,7 @@ async fn handle_status_change(
     line_number: Option<i64>,
     new_status: VideoStatus,
 ) -> Result<()> {
-    let hash = shared.hash.realize(&app).await?;
+    let hash = shared.hash.realize(app).await?;
     let video_options = VideoOptions::new(
         shared
             .subtitle_langs
@@ -81,9 +81,5 @@ async fn handle_status_change(
 fn compute_priority(line_number: Option<i64>, priority: Option<i64>) -> Option<i64> {
     if let Some(pri) = priority {
         Some(pri)
-    } else if let Some(pri) = line_number {
-        Some(pri)
-    } else {
-        None
-    }
+    } else { line_number }
 }