mirror of
https://github.com/tealdeer-rs/tealdeer.git
synced 2026-08-09 09:49:10 +02:00
Run cargo +nightly clippy --fix and formatting (#442)
This commit is contained in:
parent
9a83b58d51
commit
49626977ff
6 changed files with 8 additions and 14 deletions
|
|
@ -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:?}",)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
||||
|
|
|
|||
|
|
@ -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)?;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue