File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -513,12 +513,13 @@ impl InputHandler {
513
513
MouseEventKind :: ScrollUp => self . previous ( ) ,
514
514
MouseEventKind :: ScrollDown => self . next ( ) ,
515
515
MouseEventKind :: Down ( MouseButton :: Left ) => {
516
- if let Some ( header) = self . gui_state . lock ( ) . header_intersect ( Rect :: new (
516
+ let header = self . gui_state . lock ( ) . header_intersect ( Rect :: new (
517
517
mouse_event. column ,
518
518
mouse_event. row ,
519
519
1 ,
520
520
1 ,
521
- ) ) {
521
+ ) ) ;
522
+ if let Some ( header) = header {
522
523
self . sort ( header) ;
523
524
}
524
525
Original file line number Diff line number Diff line change @@ -139,7 +139,8 @@ async fn main() {
139
139
info ! ( "in debug mode\n " ) ;
140
140
// Debug mode for testing, less pointless now, will display some basic information
141
141
while is_running. load ( Ordering :: SeqCst ) {
142
- if let Some ( err) = app_data. lock ( ) . get_error ( ) {
142
+ let err = app_data. lock ( ) . get_error ( ) ;
143
+ if let Some ( err) = err {
143
144
error ! ( "{}" , err) ;
144
145
process:: exit ( 1 ) ;
145
146
}
Original file line number Diff line number Diff line change @@ -294,7 +294,8 @@ pub fn ports(
294
294
app_data : & Arc < Mutex < AppData > > ,
295
295
max_lens : ( usize , usize , usize ) ,
296
296
) {
297
- if let Some ( ports) = app_data. lock ( ) . get_selected_ports ( ) {
297
+ let ports = app_data. lock ( ) . get_selected_ports ( ) ;
298
+ if let Some ( ports) = ports {
298
299
let block = Block :: default ( )
299
300
. borders ( Borders :: ALL )
300
301
. border_type ( BorderType :: Rounded )
@@ -344,7 +345,8 @@ pub fn ports(
344
345
345
346
/// Draw the cpu + mem charts
346
347
pub fn chart ( f : & mut Frame , area : Rect , app_data : & Arc < Mutex < AppData > > ) {
347
- if let Some ( ( cpu, mem) ) = app_data. lock ( ) . get_chart_data ( ) {
348
+ let cpu_mem = app_data. lock ( ) . get_chart_data ( ) ;
349
+ if let Some ( ( cpu, mem) ) = cpu_mem {
348
350
let area = Layout :: default ( )
349
351
. direction ( Direction :: Horizontal )
350
352
. constraints ( CONSTRAINT_50_50 )
Original file line number Diff line number Diff line change @@ -114,8 +114,7 @@ impl Ui {
114
114
) ?;
115
115
disable_raw_mode ( ) ?;
116
116
self . terminal . clear ( ) . ok ( ) ;
117
- self . terminal
118
- . set_cursor_position ( self . cursor_position ) ?;
117
+ self . terminal . set_cursor_position ( self . cursor_position ) ?;
119
118
Ok ( self . terminal . show_cursor ( ) ?)
120
119
}
121
120
You can’t perform that action at this time.
0 commit comments