From 5c83dec07b3bac23bd82df6918325cd3b422a8ce Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 14 Dec 2021 15:21:47 -0600 Subject: [PATCH] style: Remove unused variable --- crates/typos/src/tokens.rs | 3 +-- src/bin/typos-cli/report.rs | 3 --- src/dict.rs | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/typos/src/tokens.rs b/crates/typos/src/tokens.rs index 20750fd..a340729 100644 --- a/crates/typos/src/tokens.rs +++ b/crates/typos/src/tokens.rs @@ -55,8 +55,7 @@ impl Tokenizer { pub fn parse_bytes<'c>(&'c self, content: &'c [u8]) -> impl Iterator> { let iter = if self.unicode && !ByteSlice::is_ascii(content) { - let iter = - Utf8Chunks::new(content).flat_map(move |c| unicode_parser::iter_identifiers(c)); + let iter = Utf8Chunks::new(content).flat_map(unicode_parser::iter_identifiers); itertools::Either::Left(iter) } else { itertools::Either::Right(ascii_parser::iter_identifiers(content)) diff --git a/src/bin/typos-cli/report.rs b/src/bin/typos-cli/report.rs index 0d20f2c..d23d795 100644 --- a/src/bin/typos-cli/report.rs +++ b/src/bin/typos-cli/report.rs @@ -8,7 +8,6 @@ use typos_cli::report::{Context, Message, Report, Typo}; #[derive(Copy, Clone, Debug)] pub struct Palette { error: yansi::Style, - warn: yansi::Style, info: yansi::Style, strong: yansi::Style, } @@ -17,7 +16,6 @@ impl Palette { pub fn colored() -> Self { Self { error: yansi::Style::new(yansi::Color::Red), - warn: yansi::Style::new(yansi::Color::Yellow), info: yansi::Style::new(yansi::Color::Blue), strong: yansi::Style::default().bold(), } @@ -26,7 +24,6 @@ impl Palette { pub fn plain() -> Self { Self { error: yansi::Style::default(), - warn: yansi::Style::default(), info: yansi::Style::default(), strong: yansi::Style::default(), } diff --git a/src/dict.rs b/src/dict.rs index 6206c2f..26f527c 100644 --- a/src/dict.rs +++ b/src/dict.rs @@ -46,7 +46,7 @@ impl BuiltIn { }; corrections .corrections_mut() - .for_each(|mut s| case_correct(&mut s, word_token.case())); + .for_each(|s| case_correct(s, word_token.case())); Some(corrections) } }