From 22e9eff0d7ae3e044ac3b61b4817ce0060c2120b Mon Sep 17 00:00:00 2001 From: Mroik Date: Wed, 11 Mar 2026 01:14:23 +0100 Subject: Fix some clippy stuff --- src/app.rs | 6 +++--- src/config.rs | 1 + src/main.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/app.rs b/src/app.rs index 476b4a7..2aee404 100644 --- a/src/app.rs +++ b/src/app.rs @@ -112,8 +112,8 @@ impl App<'_> { self.mistake_count ); } - if self.error.is_some() { - println!("{}", self.error.as_ref().unwrap()); + if let Some(e) = self.error.as_ref() { + println!("{}", e); } return Ok(()); } @@ -260,7 +260,7 @@ impl App<'_> { .iter() .map(|line| line.len()) .sum::(); - for i in 0..lines[current_line].len() { + for (i, _) in lines[current_line].iter().enumerate() { if i + offset < self.state.current { self.stdout .queue(SetForegroundColor(Color::Green))? diff --git a/src/config.rs b/src/config.rs index 23bef3b..c955b02 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,3 +1,4 @@ +#![allow(clippy::type_complexity)] use std::{env, fs, path::PathBuf}; use anyhow::{Result, anyhow}; diff --git a/src/main.rs b/src/main.rs index a57c99f..c530dc4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,7 +66,7 @@ async fn main() -> Result<()> { } else if let Some(q) = &args.quote { let path = Path::new(q); let mut quotes = generate_quotes(path).unwrap(); - let mut rng = rand::rand_core::UnwrapErr(rand::rngs::SysRng::default()); + let mut rng = rand::rand_core::UnwrapErr(rand::rngs::SysRng); let chosen = rng.next_u64() as usize; Quote { text: quotes.remove(chosen), -- cgit v1.3