diff --git a/src/game/check_player.rs b/src/game/check_player.rs index 39663c5..0a3858a 100644 --- a/src/game/check_player.rs +++ b/src/game/check_player.rs @@ -1,11 +1,17 @@ use crate::game::Game; +/// Return value for check functions +#[derive(Debug)] pub enum PlayerCheck { + /// The value checks out Ok(String), + + /// There is one or more issues Err(Vec), } impl Game { + /// Check the player name to ensure it meets guidelines pub fn check_player_name>(&self, name: S) -> PlayerCheck { let name = name.into(); let name = name.trim(); @@ -31,6 +37,7 @@ impl Game { } } + /// Check the password to ensure it meets password requirements pub fn check_player_password>(&self, password: S) -> PlayerCheck { let password = password.into(); let mut err_vec = Vec::::new();