File tree 2 files changed +4
-20
lines changed
2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,9 @@ fn main() -> io::Result<()> {
218
218
219
219
let backend = CrosstermBackend :: new ( io:: stdout ( ) ) ;
220
220
let mut terminal = Terminal :: new ( backend) ?;
221
+ let contents = opt
222
+ . gen_contents ( )
223
+ . expect ( "Couldn't get test contents. Make sure the specified language actually exists." ) ;
221
224
222
225
terminal:: enable_raw_mode ( ) ?;
223
226
execute ! (
@@ -228,13 +231,7 @@ fn main() -> io::Result<()> {
228
231
) ?;
229
232
terminal. clear ( ) ?;
230
233
231
- let mut state = State :: Test ( Test :: new (
232
- opt. gen_contents ( ) . expect (
233
- "Couldn't get test contents. Make sure the specified language actually exists." ,
234
- ) ,
235
- !opt. no_backtrack ,
236
- opt. sudden_death ,
237
- ) ) ;
234
+ let mut state = State :: Test ( Test :: new ( contents, !opt. no_backtrack , opt. sudden_death ) ) ;
238
235
239
236
state. render_into ( & mut terminal, & config) ?;
240
237
loop {
Original file line number Diff line number Diff line change @@ -43,19 +43,6 @@ impl fmt::Display for Fraction {
43
43
}
44
44
}
45
45
46
- pub trait PartialResults {
47
- fn progress ( & self ) -> Fraction ;
48
- }
49
-
50
- impl PartialResults for Test {
51
- fn progress ( & self ) -> Fraction {
52
- Fraction {
53
- numerator : self . current_word + 1 ,
54
- denominator : self . words . len ( ) ,
55
- }
56
- }
57
- }
58
-
59
46
pub struct TimingData {
60
47
// Instead of storing WPM, we store CPS (clicks per second)
61
48
pub overall_cps : f64 ,
You can’t perform that action at this time.
0 commit comments