From eb9999b85b3392e3024cdc2b3aaaa150f717c113 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sun, 19 Mar 2023 18:54:44 +0100 Subject: [PATCH] Fix build issue --- .../src/ui_screens/configure_game_rules.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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