diff options
author | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
commit | 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 (patch) | |
tree | a6fbcb4cb3ea575cac0dddb45d88ed103301dfbf /src/types.rs | |
parent | 2826d78bbfab50eab90e5a1611576f33e752b7d8 (diff) |
*really* basic public lobby
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/types.rs b/src/types.rs index 1c9ae89..84e7d46 100644 --- a/src/types.rs +++ b/src/types.rs @@ -62,13 +62,18 @@ impl Display for Player { } } -#[derive(Eq, PartialEq, Hash, Debug, Clone)] +#[derive(Eq, PartialEq, Hash, Debug, Clone, serde::Serialize)] pub struct RoomId(pub String); impl Display for RoomId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0) } } +impl std::borrow::Borrow<str> for RoomId { + fn borrow(&self) -> &str { + self.0.borrow() + } +} impl RoomId { pub fn new_in<T>(map: &HashMap<RoomId, T>) -> Self { |