File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -733,8 +733,10 @@ impl Reedline {
733
733
734
734
let mut latest_resize = None ;
735
735
loop {
736
- if !self . reedline_event_queue . lock ( ) . unwrap ( ) . is_empty ( ) {
737
- break ;
736
+ if let Ok ( queue) = self . reedline_event_queue . lock ( ) {
737
+ if !queue. is_empty ( ) {
738
+ break ;
739
+ }
738
740
}
739
741
match event:: read ( ) ? {
740
742
Event :: Resize ( x, y) => {
@@ -804,9 +806,11 @@ impl Reedline {
804
806
reedline_events. push ( ReedlineEvent :: Edit ( ec) ) ;
805
807
}
806
808
807
- for event in self . reedline_event_queue . lock ( ) . unwrap ( ) . drain ( ..) {
808
- println ! ( "Got event from queue: {}" , event) ;
809
- reedline_events. push ( event) ;
809
+ if let Ok ( mut queue) = self . reedline_event_queue . lock ( ) {
810
+ for event in queue. drain ( ..) {
811
+ println ! ( "Got event from queue: {}" , event) ;
812
+ reedline_events. push ( event) ;
813
+ }
810
814
}
811
815
812
816
for event in reedline_events. drain ( ..) {
You can’t perform that action at this time.
0 commit comments