From 5d30f038267a7c98fda0875957a9126e8ad1daa2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 10 Aug 2020 12:22:33 +0200 Subject: [PATCH] impl PartialEq between Realm and RealmRef Signed-off-by: Wolfgang Bumiller --- src/api2/types/userid.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/api2/types/userid.rs b/src/api2/types/userid.rs index 31a6a4a4..bdf383de 100644 --- a/src/api2/types/userid.rs +++ b/src/api2/types/userid.rs @@ -268,6 +268,24 @@ impl PartialEq<&str> for RealmRef { } } +impl PartialEq for Realm { + fn eq(&self, rhs: &RealmRef) -> bool { + self.0 == &rhs.0 + } +} + +impl PartialEq for RealmRef { + fn eq(&self, rhs: &Realm) -> bool { + self.0 == rhs.0 + } +} + +impl PartialEq for &RealmRef { + fn eq(&self, rhs: &Realm) -> bool { + (*self).0 == rhs.0 + } +} + /// A complete user id consting of a user name and a realm. #[derive(Clone, Debug, Hash)] pub struct Userid {