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/roomid.rs | |
| parent | c71ecb48fa4368035a852e2d06869a21382a6876 (diff) | |
refactoring: roomid is now a type, not string anymore
Diffstat (limited to 'src/roomid.rs')
| -rw-r--r-- | src/roomid.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/roomid.rs b/src/roomid.rs new file mode 100644 index 0000000..1f356fa --- /dev/null +++ b/src/roomid.rs @@ -0,0 +1,15 @@ + +#[derive(Debug, PartialEq, Eq, Clone, Hash)] +pub struct RoomId { + pub name: String +} + +impl RoomId { + pub fn from_str(name: &str) -> Self { + Self {name: name.to_string()} + } + pub fn to_string(&self) -> String { + self.name.clone() + } +} + |
