mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
Fix Rust 1.95 clippy lints
This commit is contained in:
parent
6c65c8f71c
commit
24e7f383b8
5 changed files with 6 additions and 8 deletions
|
|
@ -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:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue