Derive Eq and Hash for ID types.

This commit is contained in:
Jimmy Cuadra 2016-07-28 02:57:36 -07:00
parent 6032f730f8
commit 28fdff9a65

View File

@ -74,7 +74,7 @@ pub enum Error {
/// "$h29iv0s8:example.com"
/// );
/// ```
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct EventId {
hostname: Host,
opaque_id: String,
@ -95,7 +95,7 @@ pub struct EventId {
/// "#ruma:example.com"
/// );
/// ```
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct RoomAliasId {
alias: String,
hostname: Host,
@ -116,7 +116,7 @@ pub struct RoomAliasId {
/// "!n8f893n9:example.com"
/// );
/// ```
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct RoomId {
hostname: Host,
opaque_id: String,
@ -137,7 +137,7 @@ pub struct RoomId {
/// "@carl:example.com"
/// );
/// ```
#[derive(Debug, PartialEq)]
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct UserId {
hostname: Host,
localpart: String,