@@ -24,7 +24,7 @@ use crate::{
24
24
SPINNER_INTERVAL , TICK_INTERVAL ,
25
25
} ;
26
26
27
- pub ( crate ) struct Gitui {
27
+ pub struct Gitui {
28
28
app : crate :: app:: App ,
29
29
rx_input : Receiver < InputEvent > ,
30
30
rx_git : Receiver < AsyncGitNotification > ,
@@ -62,8 +62,7 @@ impl Gitui {
62
62
input. clone ( ) ,
63
63
theme,
64
64
key_config. clone ( ) ,
65
- )
66
- . unwrap ( ) ;
65
+ ) ?;
67
66
68
67
Ok ( Self {
69
68
app,
@@ -130,7 +129,7 @@ impl Gitui {
130
129
QueueEvent :: SpinnerUpdate => unreachable ! ( ) ,
131
130
}
132
131
133
- self . draw ( terminal) ;
132
+ self . draw ( terminal) ? ;
134
133
135
134
spinner. set_state ( self . app . any_work_pending ( ) ) ;
136
135
spinner. draw ( terminal) ?;
@@ -145,10 +144,10 @@ impl Gitui {
145
144
}
146
145
147
146
fn draw < B : ratatui:: backend:: Backend > (
148
- & mut self ,
147
+ & self ,
149
148
terminal : & mut ratatui:: Terminal < B > ,
150
- ) {
151
- draw ( terminal, & self . app ) . unwrap ( ) ;
149
+ ) -> std :: io :: Result < ( ) > {
150
+ draw ( terminal, & self . app )
152
151
}
153
152
154
153
#[ cfg( test) ]
@@ -224,7 +223,7 @@ mod tests {
224
223
let mut terminal =
225
224
Terminal :: new ( TestBackend :: new ( 120 , 40 ) ) . unwrap ( ) ;
226
225
227
- gitui. draw ( & mut terminal) ;
226
+ gitui. draw ( & mut terminal) . unwrap ( ) ;
228
227
229
228
sleep ( Duration :: from_millis ( 500 ) ) ;
230
229
@@ -236,7 +235,7 @@ mod tests {
236
235
237
236
sleep ( Duration :: from_millis ( 500 ) ) ;
238
237
239
- gitui. draw ( & mut terminal) ;
238
+ gitui. draw ( & mut terminal) . unwrap ( ) ;
240
239
241
240
assert_snapshot ! ( "app_loading_finished" , terminal. backend( ) ) ;
242
241
@@ -250,7 +249,7 @@ mod tests {
250
249
251
250
gitui. update ( ) ;
252
251
253
- gitui. draw ( & mut terminal) ;
252
+ gitui. draw ( & mut terminal) . unwrap ( ) ;
254
253
255
254
assert_snapshot ! (
256
255
"app_log_tab_showing_one_commit" ,
0 commit comments