From 17ecc72f8998c3d856d374cec0a8f5a48c2578a2 Mon Sep 17 00:00:00 2001 From: ophir Date: Sun, 12 Mar 2023 01:38:19 +0100 Subject: [PATCH] clippy fix clippy warnings with the latest clippy --- src/auto.rs | 1 - src/google_arts_and_culture/tile_info.rs | 2 +- src/output_file.rs | 2 +- src/pff/mod.rs | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/auto.rs b/src/auto.rs index f63e378..04eb2b0 100644 --- a/src/auto.rs +++ b/src/auto.rs @@ -21,7 +21,6 @@ pub fn all_dezoomers(include_generic: bool) -> Vec> { } dezoomers } - pub struct AutoDezoomer { dezoomers: Vec>, errors: Vec<(&'static str, DezoomerError)>, diff --git a/src/google_arts_and_culture/tile_info.rs b/src/google_arts_and_culture/tile_info.rs index 75c27d0..f31098b 100644 --- a/src/google_arts_and_culture/tile_info.rs +++ b/src/google_arts_and_culture/tile_info.rs @@ -54,7 +54,7 @@ impl FromStr for PageInfo { let name = Regex::new(r#""name":"([^"]+)"#) .unwrap() .captures(s) - .map(|c| (c[1]).to_string()) + .map(|c| c[1].to_string()) .unwrap_or_else(|| "Google Arts and culture image".into()); Ok(PageInfo { diff --git a/src/output_file.rs b/src/output_file.rs index d985dad..8365b26 100644 --- a/src/output_file.rs +++ b/src/output_file.rs @@ -40,7 +40,7 @@ pub fn get_outname( let mut path = base_dir.to_path_buf(); let mut base_with_ext = OsString::from(&base); base_with_ext.push("."); - base_with_ext.push(&extension); + base_with_ext.push(extension); path = path.join(base_with_ext); // append a suffix (_1,_2,..) to `outname` if the file already exists diff --git a/src/pff/mod.rs b/src/pff/mod.rs index 47eb802..27a865e 100644 --- a/src/pff/mod.rs +++ b/src/pff/mod.rs @@ -16,13 +16,13 @@ mod image_properties; /// Dezoomer for Zoomify PFF. /// Takes an URL to a pff file +#[derive(Default)] pub enum PFF { + #[default] Init, WithHeader(HeaderInfo), } -impl Default for PFF { fn default() -> Self { PFF::Init } } - custom_error! {pub PffError DecodeError{source: serde_urlencoded::de::Error} = "Invalid meta information file: {source}", EncodeError{source: serde_urlencoded::ser::Error} = "Unable to generate URL: {source}",