aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/app.rs b/src/app.rs
index 5ad4f9e..79a82cf 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -35,6 +35,7 @@ pub struct App {
state: State,
should_render: bool,
start: Option<Instant>,
+ completed: bool,
}
impl App {
@@ -53,6 +54,7 @@ impl App {
state: State::default(),
should_render: true,
start: None,
+ completed: false,
}
}
@@ -85,7 +87,9 @@ impl App {
disable_raw_mode()?;
self.stdout.execute(LeaveAlternateScreen)?;
- println!("Your WPM: {}", wpm.round());
+ if self.completed {
+ println!("Your WPM: {}", wpm.round());
+ }
return Ok(());
}
@@ -111,6 +115,7 @@ impl App {
self.state.buffer.clear();
self.state.current += 1;
if self.state.current == self.quote.len() {
+ self.completed = true;
self.running = false;
}
} else {
XMR address: 854DmXNrxULU3ZFJVs4Wc8PFhbq29RhqHhY8W6cdWrtFN3qmooKyyeYPcDzZTNRxphhJ5UzASQfAdEMwSteVqymk28aLhqj