From 09a8a444f5bcefaee8b83dc129a3cea2de8792f9 Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Sun, 8 Oct 2017 22:49:22 +0200 Subject: Generate `Default` for CurrentUser and use it in `Cache::default` --- src/model/mod.rs | 2 +- src/model/user.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/model') diff --git a/src/model/mod.rs b/src/model/mod.rs index bf3ac07..0817094 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -48,7 +48,7 @@ macro_rules! id_u64 { ($(#[$attr:meta] $name:ident;)*) => { $( #[$attr] - #[derive(Copy, Clone, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] + #[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] #[allow(derive_hash_xor_eq)] pub struct $name(pub u64); diff --git a/src/model/user.rs b/src/model/user.rs index 3ae33aa..39efa10 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -21,7 +21,7 @@ use CACHE; use http::{self, GuildPagination}; /// Information about the current user. -#[derive(Clone, Debug, Deserialize)] +#[derive(Clone, Default, Debug, Deserialize)] pub struct CurrentUser { pub id: UserId, pub avatar: Option, -- cgit v1.2.3