diff options
Diffstat (limited to 'mumd/src/state')
| -rw-r--r-- | mumd/src/state/channel.rs | 13 | ||||
| -rw-r--r-- | mumd/src/state/server.rs | 2 | ||||
| -rw-r--r-- | mumd/src/state/user.rs | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/mumd/src/state/channel.rs b/mumd/src/state/channel.rs index 6995e1e..2ed05c5 100644 --- a/mumd/src/state/channel.rs +++ b/mumd/src/state/channel.rs @@ -169,13 +169,10 @@ pub fn into_channel( impl From<&Channel> for mumlib::state::Channel { fn from(channel: &Channel) -> Self { - mumlib::state::Channel { - description: channel.description.clone(), - links: Vec::new(), - max_users: channel.max_users, - name: channel.name.clone(), - children: Vec::new(), - users: Vec::new(), - } + mumlib::state::Channel::new( + channel.name.clone(), + channel.description.clone(), + channel.max_users, + ) } } diff --git a/mumd/src/state/server.rs b/mumd/src/state/server.rs index 4abde49..5d49457 100644 --- a/mumd/src/state/server.rs +++ b/mumd/src/state/server.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use std::collections::hash_map::Entry; use std::collections::HashMap; -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Server { channels: HashMap<u32, Channel>, users: HashMap<u32, User>, diff --git a/mumd/src/state/user.rs b/mumd/src/state/user.rs index 5770bca..0ffde90 100644 --- a/mumd/src/state/user.rs +++ b/mumd/src/state/user.rs @@ -78,7 +78,7 @@ impl User { } } - pub fn apply_user_diff(&mut self, diff: &crate::state::user::UserDiff) { + pub fn apply_user_diff(&mut self, diff: &UserDiff) { if let Some(comment) = diff.comment.clone() { self.comment = Some(comment); } |
