summaryrefslogtreecommitdiff
path: root/src/playerid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/playerid.rs')
-rw-r--r--src/playerid.rs8
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()
+ }
+}