From b760d8a23ff89225d61a1b0c04d00aca42a83c22 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 30 Nov 2020 14:08:57 +0100 Subject: [PATCH] derive PartialEq for Userid the manual implementation is equivalent Signed-off-by: Wolfgang Bumiller --- src/api2/types/userid.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/api2/types/userid.rs b/src/api2/types/userid.rs index 42271904..0ad64954 100644 --- a/src/api2/types/userid.rs +++ b/src/api2/types/userid.rs @@ -419,12 +419,10 @@ impl<'a> TryFrom<&'a str> for &'a TokennameRef { } /// A complete user id consisting of a user name and a realm -#[derive(Clone, Debug, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct Userid { data: String, name_len: usize, - //name: Username, - //realm: Realm, } impl Userid { @@ -460,14 +458,6 @@ lazy_static! { pub static ref ROOT_USERID: Userid = Userid::new("root@pam".to_string(), 4); } -impl Eq for Userid {} - -impl PartialEq for Userid { - fn eq(&self, rhs: &Self) -> bool { - self.data == rhs.data && self.name_len == rhs.name_len - } -} - impl From for Userid { fn from(authid: Authid) -> Self { authid.user