Run cargo +nightly clippy --fix and formatting (#442)

This commit is contained in:
Niklas Mohrin 2025-10-03 22:44:39 +02:00 committed by GitHub
commit 49626977ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 14 deletions

View file

@ -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:?}",)
}
}
}

View file

@ -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};

View file

@ -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)?;

View file

@ -53,7 +53,7 @@ impl<R: BufRead> Iterator for LineIterator<R> {
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<R: BufRead> Iterator for LineIterator<R> {
.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;

View file

@ -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",

View file

@ -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,