From a60cd8f2a96aae3f7db8dfccec2aa5cf21f8c411 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 25 Aug 2024 17:30:02 +0200 Subject: refactor(treewide): Conform to `cargo clippy` --- src/update/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/update/mod.rs') 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, verbosity: u8, ) -> Result<()> { - let subscriptions = get_subscriptions(&app).await?; + let subscriptions = get_subscriptions(app).await?; let mut back_subs: HashMap = 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::>()) + .args(hashes.iter().map(|haz| haz.to_string()).collect::>()) .stdout(Stdio::piped()) .stderr(if logging { Stdio::inherit() @@ -124,7 +124,7 @@ async fn process_subscription( app: &App, sub: &Subscription, entry: InfoJson, - hashes: &Vec, + 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(), -- cgit 1.4.1