From 3e4b34b2dabdffee059aaef6eb7266056dc6cc34 Mon Sep 17 00:00:00 2001 From: Benjamin Klum Date: Fri, 27 Dec 2024 15:28:41 +0100 Subject: [PATCH] #1382 Fix "entered unreachable code" error when interacting with UI --- main/src/infrastructure/ui/group_panel.rs | 2 +- main/src/infrastructure/ui/header_panel.rs | 6 +++--- main/src/infrastructure/ui/mapping_header_panel.rs | 4 ++-- main/src/infrastructure/ui/mapping_panel.rs | 6 +++--- main/src/infrastructure/ui/mapping_row_panel.rs | 2 +- main/src/infrastructure/ui/message_panel.rs | 2 +- main/src/infrastructure/ui/session_message_panel.rs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/src/infrastructure/ui/group_panel.rs b/main/src/infrastructure/ui/group_panel.rs index c53cae654..2e6c4055e 100644 --- a/main/src/infrastructure/ui/group_panel.rs +++ b/main/src/infrastructure/ui/group_panel.rs @@ -100,7 +100,7 @@ impl View for GroupPanel { ID_GROUP_PANEL_OK | raw::IDCANCEL => { self.close(); } - _ => unreachable!(), + _ => {} } } } diff --git a/main/src/infrastructure/ui/header_panel.rs b/main/src/infrastructure/ui/header_panel.rs index d5a97ccbf..af296b1b5 100644 --- a/main/src/infrastructure/ui/header_panel.rs +++ b/main/src/infrastructure/ui/header_panel.rs @@ -1947,7 +1947,7 @@ impl HeaderPanel { .borrow(); Some(GroupFilter(group.id())) } - _ => unreachable!(), + _ => unreachable!("unexpected group combo box item data"), }; self.main_state .borrow_mut() @@ -2911,7 +2911,7 @@ impl View for HeaderPanel { match resource_id { root::ID_GROUP_COMBO_BOX => self.update_group(), root::ID_AUTO_LOAD_COMBO_BOX => self.update_preset_auto_load_mode(), - _ => unreachable!(), + _ => {} } } @@ -2926,7 +2926,7 @@ impl View for HeaderPanel { } match resource_id { root::ID_HEADER_SEARCH_EDIT_CONTROL => self.update_search_expression(), - _ => unreachable!(), + _ => {} } true } diff --git a/main/src/infrastructure/ui/mapping_header_panel.rs b/main/src/infrastructure/ui/mapping_header_panel.rs index 39b3c72e4..efd310c09 100644 --- a/main/src/infrastructure/ui/mapping_header_panel.rs +++ b/main/src/infrastructure/ui/mapping_header_panel.rs @@ -657,7 +657,7 @@ impl View for MappingHeaderPanel { ID_MAPPING_ACTIVATION_SETTING_2_CHECK_BOX => { self.with_session_and_item(Self::update_activation_setting_2_on); } - _ => unreachable!(), + _ => {} } } @@ -667,7 +667,7 @@ impl View for MappingHeaderPanel { ID_MAPPING_ACTIVATION_TYPE_COMBO_BOX => { self.with_session_and_item(Self::update_activation_type); } - _ => unreachable!(), + _ => {} } } diff --git a/main/src/infrastructure/ui/mapping_panel.rs b/main/src/infrastructure/ui/mapping_panel.rs index e5116c891..029df7903 100644 --- a/main/src/infrastructure/ui/mapping_panel.rs +++ b/main/src/infrastructure/ui/mapping_panel.rs @@ -7280,7 +7280,7 @@ impl View for MappingPanel { let _ = self.read(|p| p.hit_target_special(true)); } root::ID_TARGET_UNIT_BUTTON => self.write(|p| p.handle_target_unit_button_press()), - _ => unreachable!(), + _ => {} } } @@ -7340,7 +7340,7 @@ impl View for MappingPanel { root::ID_TARGET_LINE_4_COMBO_BOX_2 => { self.write(|p| p.handle_target_line_4_combo_box_2_change()) } - _ => unreachable!(), + _ => {} } } @@ -7377,7 +7377,7 @@ impl View for MappingPanel { s if s == sliders.target_value => { let _ = self.read(|p| p.hit_target(s.slider_unit_value())); } - _ => unreachable!(), + _ => {} }; } diff --git a/main/src/infrastructure/ui/mapping_row_panel.rs b/main/src/infrastructure/ui/mapping_row_panel.rs index 5da5ebbcd..f11cfb075 100644 --- a/main/src/infrastructure/ui/mapping_row_panel.rs +++ b/main/src/infrastructure/ui/mapping_row_panel.rs @@ -940,7 +940,7 @@ impl View for MappingRowPanel { root::ID_MAPPING_ROW_LEARN_TARGET_BUTTON => self.toggle_learn_target(), root::ID_MAPPING_ROW_CONTROL_CHECK_BOX => self.update_control_is_enabled(), root::ID_MAPPING_ROW_FEEDBACK_CHECK_BOX => self.update_feedback_is_enabled(), - _ => unreachable!(), + _ => {} } } diff --git a/main/src/infrastructure/ui/message_panel.rs b/main/src/infrastructure/ui/message_panel.rs index 8a143cd08..0908b9258 100644 --- a/main/src/infrastructure/ui/message_panel.rs +++ b/main/src/infrastructure/ui/message_panel.rs @@ -82,7 +82,7 @@ impl View for MessagePanel { match resource_id { // Escape key raw::IDCANCEL => self.close(), - _ => unreachable!(), + _ => {} } } } diff --git a/main/src/infrastructure/ui/session_message_panel.rs b/main/src/infrastructure/ui/session_message_panel.rs index 96cebbbb1..f6d2f8e2c 100644 --- a/main/src/infrastructure/ui/session_message_panel.rs +++ b/main/src/infrastructure/ui/session_message_panel.rs @@ -118,7 +118,7 @@ impl View for SessionMessagePanel { match resource_id { // Escape key raw::IDCANCEL => self.close(), - _ => unreachable!(), + _ => {} } } }