@@ -24,7 +24,7 @@ use crate::{
2424 SPINNER_INTERVAL , TICK_INTERVAL ,
2525} ;
2626
27- pub ( crate ) struct Gitui {
27+ pub struct Gitui {
2828 app : crate :: app:: App ,
2929 rx_input : Receiver < InputEvent > ,
3030 rx_git : Receiver < AsyncGitNotification > ,
@@ -62,8 +62,7 @@ impl Gitui {
6262 input. clone ( ) ,
6363 theme,
6464 key_config. clone ( ) ,
65- )
66- . unwrap ( ) ;
65+ ) ?;
6766
6867 Ok ( Self {
6968 app,
@@ -130,7 +129,7 @@ impl Gitui {
130129 QueueEvent :: SpinnerUpdate => unreachable ! ( ) ,
131130 }
132131
133- self . draw ( terminal) ;
132+ self . draw ( terminal) ? ;
134133
135134 spinner. set_state ( self . app . any_work_pending ( ) ) ;
136135 spinner. draw ( terminal) ?;
@@ -145,10 +144,10 @@ impl Gitui {
145144 }
146145
147146 fn draw < B : ratatui:: backend:: Backend > (
148- & mut self ,
147+ & self ,
149148 terminal : & mut ratatui:: Terminal < B > ,
150- ) {
151- draw ( terminal, & self . app ) . unwrap ( ) ;
149+ ) -> std :: io :: Result < ( ) > {
150+ draw ( terminal, & self . app )
152151 }
153152
154153 #[ cfg( test) ]
@@ -224,7 +223,7 @@ mod tests {
224223 let mut terminal =
225224 Terminal :: new ( TestBackend :: new ( 120 , 40 ) ) . unwrap ( ) ;
226225
227- gitui. draw ( & mut terminal) ;
226+ gitui. draw ( & mut terminal) . unwrap ( ) ;
228227
229228 sleep ( Duration :: from_millis ( 500 ) ) ;
230229
@@ -236,7 +235,7 @@ mod tests {
236235
237236 sleep ( Duration :: from_millis ( 500 ) ) ;
238237
239- gitui. draw ( & mut terminal) ;
238+ gitui. draw ( & mut terminal) . unwrap ( ) ;
240239
241240 assert_snapshot ! ( "app_loading_finished" , terminal. backend( ) ) ;
242241
@@ -250,7 +249,7 @@ mod tests {
250249
251250 gitui. update ( ) ;
252251
253- gitui. draw ( & mut terminal) ;
252+ gitui. draw ( & mut terminal) . unwrap ( ) ;
254253
255254 assert_snapshot ! (
256255 "app_log_tab_showing_one_commit" ,
0 commit comments