diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-04-27 16:40:45 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-04-27 16:40:45 -0400 |
commit | 78e3c37947fa1e8e1746b05888bec5f8dba6fd52 (patch) | |
tree | 4fc4413f588d8fb329f72e9dfd5678c3a0ba1e10 /src/canvas/widgets/basic_table_arrows.rs | |
parent | 15dba2e6cf390f329b6bbba9686667e240d45633 (diff) |
refactor: fix clippy errors
Diffstat (limited to 'src/canvas/widgets/basic_table_arrows.rs')
-rw-r--r-- | src/canvas/widgets/basic_table_arrows.rs | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/canvas/widgets/basic_table_arrows.rs b/src/canvas/widgets/basic_table_arrows.rs index 554d7690..6031aa82 100644 --- a/src/canvas/widgets/basic_table_arrows.rs +++ b/src/canvas/widgets/basic_table_arrows.rs @@ -28,14 +28,12 @@ impl BasicTableArrows for Painter { app_state .current_widget .left_neighbour - .and_then(|left_widget_id| { - Some( - app_state - .widget_map - .get(&left_widget_id) - .and_then(|left_widget| Some(&left_widget.widget_type)) - .unwrap_or_else(|| &BottomWidgetType::Temp), - ) + .map(|left_widget_id| { + app_state + .widget_map + .get(&left_widget_id) + .map(|left_widget| &left_widget.widget_type) + .unwrap_or_else(|| &BottomWidgetType::Temp) }) .unwrap_or_else(|| &BottomWidgetType::Temp) }, @@ -43,14 +41,12 @@ impl BasicTableArrows for Painter { app_state .current_widget .right_neighbour - .and_then(|right_widget_id| { - Some( - app_state - .widget_map - .get(&right_widget_id) - .and_then(|right_widget| Some(&right_widget.widget_type)) - .unwrap_or_else(|| &BottomWidgetType::Disk), - ) + .map(|right_widget_id| { + app_state + .widget_map + .get(&right_widget_id) + .map(|right_widget| &right_widget.widget_type) + .unwrap_or_else(|| &BottomWidgetType::Disk) }) .unwrap_or_else(|| &BottomWidgetType::Disk) }, |