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), Ok(response) if response.status() == StatusCode::NOT_FOUND => Ok(None),
_ => { _ => {
bail!( bail!("Could not download tldr pages from {archive_url}: {response:?}",)
"Could not download tldr pages from {archive_url}: {:?}",
response,
)
} }
} }
} }

View file

@ -2,7 +2,7 @@
use std::path::PathBuf; use std::path::PathBuf;
use clap::{arg, builder::ArgAction, command, ArgGroup, Parser}; use clap::{builder::ArgAction, ArgGroup, Parser};
use crate::types::{ColorOptions, PlatformType}; use crate::types::{ColorOptions, PlatformType};

View file

@ -68,7 +68,7 @@ where
process_snippet(PageSnippet::Linebreak)?; process_snippet(PageSnippet::Linebreak)?;
} }
LineType::Other(text) => debug!("Unknown line type: {:?}", text), LineType::Other(text) => debug!("Unknown line type: {text:?}"),
} }
} }
process_snippet(PageSnippet::Linebreak)?; process_snippet(PageSnippet::Linebreak)?;

View file

@ -53,7 +53,7 @@ impl<R: BufRead> Iterator for LineIterator<R> {
match bytes_read { match bytes_read {
Ok(0) => None, Ok(0) => None,
Err(e) => { Err(e) => {
warn!("Could not read line from reader: {:?}", e); warn!("Could not read line from reader: {e:?}");
None None
} }
Ok(_) => { Ok(_) => {
@ -68,7 +68,7 @@ impl<R: BufRead> Iterator for LineIterator<R> {
.find(|b| matches!(b, Ok(b'\n') | Err(_))) .find(|b| matches!(b, Ok(b'\n') | Err(_)))
.transpose() .transpose()
{ {
warn!("Could not read line from reader: {:?}", e); warn!("Could not read line from reader: {e:?}");
return None; return None;
} }
self.first_line = false; self.first_line = false;

View file

@ -15,6 +15,7 @@
#![allow(clippy::similar_names)] #![allow(clippy::similar_names)]
#![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)]
#[cfg(not(any( #[cfg(not(any(
feature = "native-tls", feature = "native-tls",

View file

@ -118,18 +118,14 @@ impl PlatformType {
#[derive(Debug, Eq, PartialEq, Copy, Clone, Deserialize, clap::ValueEnum)] #[derive(Debug, Eq, PartialEq, Copy, Clone, Deserialize, clap::ValueEnum)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[derive(Default)]
pub enum ColorOptions { pub enum ColorOptions {
Always, Always,
#[default]
Auto, Auto,
Never, Never,
} }
impl Default for ColorOptions {
fn default() -> Self {
Self::Auto
}
}
#[derive(Debug, Eq, PartialEq)] #[derive(Debug, Eq, PartialEq)]
pub enum LineType { pub enum LineType {
Empty, Empty,