aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-10 17:22:02 +0200
committeracdenisSK <[email protected]>2017-07-10 17:22:02 +0200
commit64bfc5471808cff59c9b4b5eef80a756f13ff5be (patch)
treea6150f3caa6e8192bad0fe30d84b4d8e03eabe8d /src
parentAdd a way to return all online members in a guild (diff)
downloadserenity-64bfc5471808cff59c9b4b5eef80a756f13ff5be.tar.xz
serenity-64bfc5471808cff59c9b4b5eef80a756f13ff5be.zip
Make `User` and `Ban` comparable and hashable
Diffstat (limited to 'src')
-rw-r--r--src/model/guild/mod.rs2
-rw-r--r--src/model/user.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs
index 03aa07e..2858a86 100644
--- a/src/model/guild/mod.rs
+++ b/src/model/guild/mod.rs
@@ -30,7 +30,7 @@ use ::builder::{EditGuild, EditMember, EditRole};
use ::constants::LARGE_THRESHOLD;
/// A representation of a banning of a user.
-#[derive(Clone, Debug, Deserialize)]
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Hash)]
pub struct Ban {
/// The reason given for this ban.
pub reason: Option<String>,
diff --git a/src/model/user.rs b/src/model/user.rs
index c53b823..9c248ba 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -366,7 +366,7 @@ impl Default for OnlineStatus {
}
/// Information about a user.
-#[derive(Clone, Debug, Deserialize)]
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Hash)]
pub struct User {
/// The unique Id of the user. Can be used to calculate the account's
/// cration date.