Skip to content

Commit

Permalink
style: Address clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Jan 2, 2021
1 parent e6a4f49 commit 1ae74a3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/typos/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl<'p, 'd> ParserBuilder<'p, 'd> {
pub fn dictionary<'d1>(self, dictionary: &'d1 dyn Dictionary) -> ParserBuilder<'p, 'd1> {
ParserBuilder {
tokenizer: self.tokenizer,
dictionary: dictionary,
dictionary,
}
}

Expand Down
19 changes: 15 additions & 4 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,21 @@ impl<'r> MessageStatus<'r> {

impl<'r> Report for MessageStatus<'r> {
fn report(&self, msg: Message) -> Result<(), std::io::Error> {
self.typos_found
.compare_and_swap(false, msg.is_correction(), atomic::Ordering::Relaxed);
self.errors_found
.compare_and_swap(false, msg.is_error(), atomic::Ordering::Relaxed);
let _ = self.typos_found.compare_exchange(
false,
msg.is_correction(),
atomic::Ordering::Relaxed,
atomic::Ordering::Relaxed,
);
let _ = self
.errors_found
.compare_exchange(
false,
msg.is_error(),
atomic::Ordering::Relaxed,
atomic::Ordering::Relaxed,
)
.unwrap();
self.reporter.report(msg)
}
}
Expand Down

0 comments on commit 1ae74a3

Please sign in to comment.