From 32dd60bca02cf2cfccc8d4309691df9f2f84398c Mon Sep 17 00:00:00 2001 From: troido Date: Tue, 18 Feb 2020 02:27:21 +0100 Subject: refactoring: roomid is now a type, not string anymore --- src/playerid.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/playerid.rs') diff --git a/src/playerid.rs b/src/playerid.rs index 8402a1c..dcb1f40 100644 --- a/src/playerid.rs +++ b/src/playerid.rs @@ -4,3 +4,11 @@ pub struct PlayerId { pub name: String } +impl PlayerId { + pub fn from_str(name: &str) -> Self { + Self {name: name.to_string()} + } + pub fn to_string(&self) -> String { + self.name.clone() + } +} -- cgit