File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ use std::{
33
33
io, panic,
34
34
time:: { Duration , Instant } ,
35
35
} ;
36
- use tui:: { backend:: CrosstermBackend , Terminal } ;
36
+ use tui:: {
37
+ backend:: { Backend , CrosstermBackend } ,
38
+ Terminal ,
39
+ } ;
37
40
38
41
static TICK_INTERVAL : Duration = Duration :: from_secs ( 5 ) ;
39
42
@@ -65,6 +68,7 @@ fn main() -> Result<()> {
65
68
let ticker = tick ( TICK_INTERVAL ) ;
66
69
67
70
app. update ( ) ;
71
+ draw ( & mut terminal, & mut app) ?;
68
72
69
73
loop {
70
74
let events: Vec < QueueEvent > =
@@ -81,7 +85,7 @@ fn main() -> Result<()> {
81
85
}
82
86
}
83
87
84
- terminal . draw ( | mut f| app . draw ( & mut f ) ) ?;
88
+ draw ( & mut terminal , & mut app ) ?;
85
89
86
90
if app. is_quit ( ) {
87
91
break ;
@@ -92,6 +96,13 @@ fn main() -> Result<()> {
92
96
Ok ( ( ) )
93
97
}
94
98
99
+ fn draw < B : Backend > (
100
+ terminal : & mut Terminal < B > ,
101
+ app : & mut App ,
102
+ ) -> io:: Result < ( ) > {
103
+ terminal. draw ( |mut f| app. draw ( & mut f) )
104
+ }
105
+
95
106
fn invalid_path ( ) -> bool {
96
107
!asyncgit:: is_repo ( asyncgit:: CWD )
97
108
}
You can’t perform that action at this time.
0 commit comments