diff --git a/src/cache.rs b/src/cache.rs index a77036d..afa3603 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -369,7 +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/config.rs b/src/config.rs index 7c29ed4..212c1e2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -431,7 +431,7 @@ fn get_languages<'a>( let mut lang_list = Vec::new(); for locale in locales { if !locale.is_ascii() { - info!("Skipping non-ASCII locale string: {}", locale); + info!("Skipping non-ASCII locale string: {locale}"); continue; } diff --git a/src/formatter.rs b/src/formatter.rs index c0d3a91..b2d6b8e 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -230,13 +230,11 @@ fn is_freestanding_substring(surrounding: &str, substring: (usize, usize)) -> bo let char_before_is_okay = surrounding[..start] .chars() .last() - .filter(|prev_char| !prev_char.is_whitespace()) - .is_none(); + .is_none_or(char::is_whitespace); let char_after_is_okay = surrounding[end..] .chars() .next() - .filter(|next_char| !next_char.is_whitespace()) - .is_none(); + .is_none_or(char::is_whitespace); char_before_is_okay && char_after_is_okay } diff --git a/src/main.rs b/src/main.rs index 5b12613..29dad95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,6 +16,7 @@ #![allow(clippy::struct_excessive_bools)] #![allow(clippy::too_many_lines)] #![allow(clippy::unnecessary_debug_formatting)] +#![allow(clippy::while_let_loop)] #[cfg(not(any( feature = "native-tls", diff --git a/src/output.rs b/src/output.rs index 117ed1e..6243b44 100644 --- a/src/output.rs +++ b/src/output.rs @@ -87,12 +87,11 @@ fn print_snippet( use PageSnippet::*; match snip { - CommandName(s) => write!(writer, "{}", s.paint(style.command_name)), + CommandName(s) | Title(s) => write!(writer, "{}", s.paint(style.command_name)), Variable(s) => write!(writer, "{}", s.paint(style.example_variable)), NormalCode(s) => write!(writer, "{}", s.paint(style.example_code)), Description(s) => write!(writer, "{}", s.paint(style.description)), Text(s) => write!(writer, "{}", s.paint(style.example_text)), - Title(s) => write!(writer, "{}", s.paint(style.command_name)), Linebreak => writeln!(writer), } }