diff options
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/types.rs b/src/types.rs index cb16042..f9f166a 100644 --- a/src/types.rs +++ b/src/types.rs @@ -85,11 +85,11 @@ impl std::borrow::Borrow<str> for RoomId { impl RoomId { pub fn new_in<T>(map: &HashMap<RoomId, T>) -> Self { use rand::{ thread_rng, Rng, distributions::Alphanumeric }; - let id = RoomId { 0: thread_rng() + let id = RoomId(thread_rng() .sample_iter(&Alphanumeric) .take(16) .map(char::from) - .collect::<String>() }; + .collect::<String>()); if map.contains_key(&id) { RoomId::new_in(map) } else { id } } |