diff options
author | stale <redkugelblitzin@gmail.com> | 2022-06-30 07:18:45 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-06-30 07:18:45 -0300 |
commit | 9a745bb56d592f9b02f94c1d681fe607670fae02 (patch) | |
tree | c8d0ba62c39b22fc3f1c20d88fa1178b8f03f68d /src/types.rs | |
parent | f70c1df91afa0a211de0b743da6c0dad59fd23be (diff) |
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 } } |