From aba6e663dfbd931883ba65208001de0215f5d3bc Mon Sep 17 00:00:00 2001 From: rasul Date: Tue, 7 Apr 2020 20:21:17 -0500 Subject: [PATCH] some comments --- src/game/check_player.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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();