|
@@ -16,6 +16,7 @@ pub struct Db {
|
|
|
connected_users: RwLock<HashMap<SessionId, User>>,
|
|
|
}
|
|
|
|
|
|
+#[derive(Clone)]
|
|
|
pub struct User {
|
|
|
pub id: Option<u32>,
|
|
|
pub username: String,
|
|
@@ -95,15 +96,4 @@ impl Db {
|
|
|
let mut connected_users = self.connected_users.write().await;
|
|
|
connected_users.remove(&session_id);
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-impl Clone for User {
|
|
|
- fn clone(&self) -> Self {
|
|
|
- User {
|
|
|
- id: self.id,
|
|
|
- username: self.username.clone(),
|
|
|
- channel_id: self.channel_id,
|
|
|
- session_id: self.session_id,
|
|
|
- }
|
|
|
- }
|
|
|
}
|