diff options
| author | troido <troido@protonmail.com> | 2020-02-18 02:27:21 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-18 02:27:21 +0100 |
| commit | 32dd60bca02cf2cfccc8d4309691df9f2f84398c (patch) | |
| tree | e6d67140f3f0ca2272f796775a9dc65e5b25484f /src/playerid.rs | |
| parent | c71ecb48fa4368035a852e2d06869a21382a6876 (diff) | |
refactoring: roomid is now a type, not string anymore
Diffstat (limited to 'src/playerid.rs')
| -rw-r--r-- | src/playerid.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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() + } +} |
