Fix Rust 1.95 clippy lints

This commit is contained in:
Niklas Mohrin 2026-04-17 22:08:42 +02:00
commit 24e7f383b8
No known key found for this signature in database
GPG key ID: 0ACD89A5C1DEB3EB
5 changed files with 6 additions and 8 deletions

View file

@ -369,7 +369,7 @@ impl Cache<'_> {
} }
Ok(response) if response.status() == StatusCode::NOT_FOUND => Ok(None), 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:?}")
} }
} }
} }

View file

@ -431,7 +431,7 @@ fn get_languages<'a>(
let mut lang_list = Vec::new(); let mut lang_list = Vec::new();
for locale in locales { for locale in locales {
if !locale.is_ascii() { if !locale.is_ascii() {
info!("Skipping non-ASCII locale string: {}", locale); info!("Skipping non-ASCII locale string: {locale}");
continue; continue;
} }

View file

@ -230,13 +230,11 @@ fn is_freestanding_substring(surrounding: &str, substring: (usize, usize)) -> bo
let char_before_is_okay = surrounding[..start] let char_before_is_okay = surrounding[..start]
.chars() .chars()
.last() .last()
.filter(|prev_char| !prev_char.is_whitespace()) .is_none_or(char::is_whitespace);
.is_none();
let char_after_is_okay = surrounding[end..] let char_after_is_okay = surrounding[end..]
.chars() .chars()
.next() .next()
.filter(|next_char| !next_char.is_whitespace()) .is_none_or(char::is_whitespace);
.is_none();
char_before_is_okay && char_after_is_okay char_before_is_okay && char_after_is_okay
} }

View file

@ -16,6 +16,7 @@
#![allow(clippy::struct_excessive_bools)] #![allow(clippy::struct_excessive_bools)]
#![allow(clippy::too_many_lines)] #![allow(clippy::too_many_lines)]
#![allow(clippy::unnecessary_debug_formatting)] #![allow(clippy::unnecessary_debug_formatting)]
#![allow(clippy::while_let_loop)]
#[cfg(not(any( #[cfg(not(any(
feature = "native-tls", feature = "native-tls",

View file

@ -87,12 +87,11 @@ fn print_snippet(
use PageSnippet::*; use PageSnippet::*;
match snip { 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)), Variable(s) => write!(writer, "{}", s.paint(style.example_variable)),
NormalCode(s) => write!(writer, "{}", s.paint(style.example_code)), NormalCode(s) => write!(writer, "{}", s.paint(style.example_code)),
Description(s) => write!(writer, "{}", s.paint(style.description)), Description(s) => write!(writer, "{}", s.paint(style.description)),
Text(s) => write!(writer, "{}", s.paint(style.example_text)), Text(s) => write!(writer, "{}", s.paint(style.example_text)),
Title(s) => write!(writer, "{}", s.paint(style.command_name)),
Linebreak => writeln!(writer), Linebreak => writeln!(writer),
} }
} }