Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Samyak2 committed Nov 25, 2023
1 parent b5226b7 commit e302c28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ToipeResults {
/// Uncorrected errors are penalized to encourage correcting errors.
pub fn wpm(&self) -> f64 {
(self.final_chars_typed_correctly as f64 / 5.0 - self.final_uncorrected_errors as f64)
.max(0.0) as f64
.max(0.0)
/ (self.duration().as_secs_f64() / 60.0)
}
}
3 changes: 1 addition & 2 deletions src/textgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<T: Seek + io::Read> RawWordSelector<T> {
let mut buffer = String::new();

fn is_letter(char: u8) -> bool {
(b'a'..=b'z').contains(&char)
char.is_ascii_lowercase()
}

loop {
Expand Down Expand Up @@ -230,7 +230,6 @@ pub trait WordSelector {
/// Returns a [`Vec`] containing `num_words` words.
fn new_words(&mut self, num_words: usize) -> Result<Vec<String>, io::Error> {
(0..num_words)
.into_iter()
.map(|_| self.new_word())
.collect()
}
Expand Down

0 comments on commit e302c28

Please sign in to comment.