about summary refs log tree commit diff stats
path: root/src/select/cmds.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-25 17:30:02 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-25 17:30:02 +0200
commita60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411 (patch)
tree24dc96e5384cf9309ae4ec00d6d91497e3253484 /src/select/cmds.rs
parentdocs(yt_dlp/progress_hook): Add a note about the possibility to calculate vid... (diff)
downloadyt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.tar.gz
yt-a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411.zip
refactor(treewide): Conform to `cargo clippy`
Diffstat (limited to '')
-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 }
 }