diff --git a/rust/sea_battle_cli_player/src/ui_screens/configure_game_rules.rs b/rust/sea_battle_cli_player/src/ui_screens/configure_game_rules.rs index 9fa4bad..c3b6769 100644 --- a/rust/sea_battle_cli_player/src/ui_screens/configure_game_rules.rs +++ b/rust/sea_battle_cli_player/src/ui_screens/configure_game_rules.rs @@ -25,7 +25,7 @@ use crate::ui_widgets::button_widget::ButtonWidget; use crate::ui_widgets::checkbox_widget::CheckboxWidget; use crate::ui_widgets::text_editor_widget::TextEditorWidget; -#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Eq, PartialEq)] +#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Eq, PartialEq, Copy, Clone)] enum EditingField { MapWidth = 0, MapHeight, @@ -128,7 +128,7 @@ impl GameRulesConfigurationScreen { } } - KeyCode::Char(c) if ('0'..='9').contains(&c) => { + KeyCode::Char(c) if c.is_ascii_digit() => { let val = c.to_string().parse::().unwrap_or_default(); if self.curr_field == EditingField::MapWidth