Skip to content

Commit

Permalink
#1382 Fix "entered unreachable code" error when interacting with UI
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Dec 27, 2024
1 parent d3f7771 commit 3e4b34b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/group_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl View for GroupPanel {
ID_GROUP_PANEL_OK | raw::IDCANCEL => {
self.close();
}
_ => unreachable!(),
_ => {}
}
}
}
6 changes: 3 additions & 3 deletions main/src/infrastructure/ui/header_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ impl HeaderPanel {
.borrow();
Some(GroupFilter(group.id()))
}
_ => unreachable!(),
_ => unreachable!("unexpected group combo box item data"),
};
self.main_state
.borrow_mut()
Expand Down Expand Up @@ -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!(),
_ => {}
}
}

Expand All @@ -2926,7 +2926,7 @@ impl View for HeaderPanel {
}
match resource_id {
root::ID_HEADER_SEARCH_EDIT_CONTROL => self.update_search_expression(),
_ => unreachable!(),
_ => {}
}
true
}
Expand Down
4 changes: 2 additions & 2 deletions main/src/infrastructure/ui/mapping_header_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
_ => {}
}
}

Expand All @@ -667,7 +667,7 @@ impl View for MappingHeaderPanel {
ID_MAPPING_ACTIVATION_TYPE_COMBO_BOX => {
self.with_session_and_item(Self::update_activation_type);
}
_ => unreachable!(),
_ => {}
}
}

Expand Down
6 changes: 3 additions & 3 deletions main/src/infrastructure/ui/mapping_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
_ => {}
}
}

Expand Down Expand Up @@ -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!(),
_ => {}
}
}

Expand Down Expand Up @@ -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!(),
_ => {}
};
}

Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/mapping_row_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(),
_ => {}
}
}

Expand Down
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/message_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl View for MessagePanel {
match resource_id {
// Escape key
raw::IDCANCEL => self.close(),
_ => unreachable!(),
_ => {}
}
}
}
2 changes: 1 addition & 1 deletion main/src/infrastructure/ui/session_message_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl View for SessionMessagePanel {
match resource_id {
// Escape key
raw::IDCANCEL => self.close(),
_ => unreachable!(),
_ => {}
}
}
}

0 comments on commit 3e4b34b

Please sign in to comment.