about summary refs log tree commit diff stats
path: root/src/update/mod.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/update/mod.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 'src/update/mod.rs')
-rw-r--r--src/update/mod.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/update/mod.rs b/src/update/mod.rs
index ce31c7b..69551ed 100644
--- a/src/update/mod.rs
+++ b/src/update/mod.rs
@@ -37,7 +37,7 @@ pub async fn update(
     subs_to_update: Vec<String>,
     verbosity: u8,
 ) -> Result<()> {
-    let subscriptions = get_subscriptions(&app).await?;
+    let subscriptions = get_subscriptions(app).await?;
     let mut back_subs: HashMap<Url, Subscription> = HashMap::new();
     let logging = verbosity > 0;
     let log_level = match verbosity {
@@ -71,7 +71,7 @@ pub async fn update(
         .arg(urls.len().to_string())
         .arg(log_level.to_string())
         .args(&urls)
-        .args(&hashes.iter().map(|haz| haz.to_string()).collect::<Vec<_>>())
+        .args(hashes.iter().map(|haz| haz.to_string()).collect::<Vec<_>>())
         .stdout(Stdio::piped())
         .stderr(if logging {
             Stdio::inherit()
@@ -124,7 +124,7 @@ async fn process_subscription(
     app: &App,
     sub: &Subscription,
     entry: InfoJson,
-    hashes: &Vec<blake3::Hash>,
+    hashes: &[blake3::Hash],
 ) -> Result<()> {
     macro_rules! unwrap_option {
         ($option:expr) => {
@@ -181,8 +181,7 @@ async fn process_subscription(
 
         // TODO: The algorithm is not exactly the best <2024-05-28>
         (Some(thumbnails), None) => Some(
-            thumbnails
-                .get(0)
+            thumbnails.first()
                 .expect("At least one should exist")
                 .url
                 .clone(),