File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,13 @@ impl Repl {
63
63
64
64
// We check for close and break here instead of making it a loop condition to get
65
65
// consistent behavior in when the user evaluates a call to close().
66
- if self . session . closing ( ) . await ? {
67
- break ;
68
- }
66
+ match self . session . closing ( ) . await {
67
+ Ok ( closing) if closing => break ,
68
+ Ok ( _) => { }
69
+ Err ( err) => {
70
+ println ! ( "Error: {:?}" , err)
71
+ }
72
+ } ;
69
73
70
74
println ! ( "{}" , output) ;
71
75
}
Original file line number Diff line number Diff line change @@ -312,12 +312,10 @@ impl ReplSession {
312
312
313
313
pub async fn closing ( & mut self ) -> Result < bool , AnyError > {
314
314
let expression = format ! ( r#"{}.closed"# , * REPL_INTERNALS_NAME ) ;
315
- let closed = self
316
- . evaluate_expression ( & expression)
317
- . await ?
318
- . result
315
+ let result = self . evaluate_expression ( & expression) . await ?. result ;
316
+ let closed = result
319
317
. value
320
- . unwrap ( )
318
+ . ok_or_else ( || anyhow ! ( result . description . unwrap( ) ) ) ?
321
319
. as_bool ( )
322
320
. unwrap ( ) ;
323
321
You can’t perform that action at this time.
0 commit comments