From 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 05:34:16 -0300 Subject: *really* basic public lobby --- src/types.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/types.rs') 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 for RoomId { + fn borrow(&self) -> &str { + self.0.borrow() + } +} impl RoomId { pub fn new_in(map: &HashMap) -> Self { -- cgit v1.2.3