diff options
| author | Mroik <mroik@delayed.space> | 2026-03-11 01:14:23 +0100 |
|---|---|---|
| committer | Mroik <mroik@delayed.space> | 2026-03-11 01:14:23 +0100 |
| commit | 22e9eff0d7ae3e044ac3b61b4817ce0060c2120b (patch) | |
| tree | 16fd8e085cad2a6a810aabb26db0d4b63bda86bb /src | |
| parent | 2c8a13769238280519fc953772a42dc2920ad84e (diff) | |
Fix some clippy stuff
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.rs | 6 | ||||
| -rw-r--r-- | src/config.rs | 1 | ||||
| -rw-r--r-- | src/main.rs | 2 |
3 files changed, 5 insertions, 4 deletions
@@ -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::<usize>(); - 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), |
