derive PartialEq for Userid
the manual implementation is equivalent Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
2c1592263d
commit
b760d8a23f
@ -419,12 +419,10 @@ impl<'a> TryFrom<&'a str> for &'a TokennameRef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A complete user id consisting of a user name and a realm
|
/// 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 {
|
pub struct Userid {
|
||||||
data: String,
|
data: String,
|
||||||
name_len: usize,
|
name_len: usize,
|
||||||
//name: Username,
|
|
||||||
//realm: Realm,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Userid {
|
impl Userid {
|
||||||
@ -460,14 +458,6 @@ lazy_static! {
|
|||||||
pub static ref ROOT_USERID: Userid = Userid::new("root@pam".to_string(), 4);
|
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<Authid> for Userid {
|
impl From<Authid> for Userid {
|
||||||
fn from(authid: Authid) -> Self {
|
fn from(authid: Authid) -> Self {
|
||||||
authid.user
|
authid.user
|
||||||
|
Loading…
Reference in New Issue
Block a user