diff --git a/src/cache.rs b/src/cache.rs index 23fd668..b181310 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -369,10 +369,7 @@ impl Cache<'_> { } Ok(response) if response.status() == StatusCode::NOT_FOUND => Ok(None), _ => { - bail!( - "Could not download tldr pages from {archive_url}: {:?}", - response, - ) + bail!("Could not download tldr pages from {archive_url}: {response:?}",) } } } diff --git a/src/cli.rs b/src/cli.rs index 55fe74f..d461a3e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,7 @@ use std::path::PathBuf; -use clap::{arg, builder::ArgAction, command, ArgGroup, Parser}; +use clap::{builder::ArgAction, ArgGroup, Parser}; use crate::types::{ColorOptions, PlatformType}; diff --git a/src/formatter.rs b/src/formatter.rs index d86de9b..5270124 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -68,7 +68,7 @@ where process_snippet(PageSnippet::Linebreak)?; } - LineType::Other(text) => debug!("Unknown line type: {:?}", text), + LineType::Other(text) => debug!("Unknown line type: {text:?}"), } } process_snippet(PageSnippet::Linebreak)?; diff --git a/src/line_iterator.rs b/src/line_iterator.rs index 2e11378..98088c0 100644 --- a/src/line_iterator.rs +++ b/src/line_iterator.rs @@ -53,7 +53,7 @@ impl Iterator for LineIterator { match bytes_read { Ok(0) => None, Err(e) => { - warn!("Could not read line from reader: {:?}", e); + warn!("Could not read line from reader: {e:?}"); None } Ok(_) => { @@ -68,7 +68,7 @@ impl Iterator for LineIterator { .find(|b| matches!(b, Ok(b'\n') | Err(_))) .transpose() { - warn!("Could not read line from reader: {:?}", e); + warn!("Could not read line from reader: {e:?}"); return None; } self.first_line = false; diff --git a/src/main.rs b/src/main.rs index fcf3273..a0cd593 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,6 +15,7 @@ #![allow(clippy::similar_names)] #![allow(clippy::struct_excessive_bools)] #![allow(clippy::too_many_lines)] +#![allow(clippy::unnecessary_debug_formatting)] #[cfg(not(any( feature = "native-tls", diff --git a/src/types.rs b/src/types.rs index 69c7599..7ca6e2d 100644 --- a/src/types.rs +++ b/src/types.rs @@ -118,18 +118,14 @@ impl PlatformType { #[derive(Debug, Eq, PartialEq, Copy, Clone, Deserialize, clap::ValueEnum)] #[serde(rename_all = "lowercase")] +#[derive(Default)] pub enum ColorOptions { Always, + #[default] Auto, Never, } -impl Default for ColorOptions { - fn default() -> Self { - Self::Auto - } -} - #[derive(Debug, Eq, PartialEq)] pub enum LineType { Empty,