diff --git a/src/user_management/manager.rs b/src/user_management/manager.rs index 426096a..da25cf9 100644 --- a/src/user_management/manager.rs +++ b/src/user_management/manager.rs @@ -71,7 +71,7 @@ impl UserManager { /// # Errors /// An error is thrown if there is an error reading from the database or if data /// recieved from the database is corrupt - pub fn lookup_user<'de, UserData>( + pub fn lookup_user( &self, username: impl AsRef<[u8]> ) -> Result>> @@ -93,7 +93,7 @@ impl UserManager { /// /// # Panics /// Pancis if the database is corrupt - pub fn get_user<'de, UserData>( + pub fn get_user( &self, cert: Option<&Certificate> ) -> Result> diff --git a/src/user_management/mod.rs b/src/user_management/mod.rs index 4384355..fbc8868 100644 --- a/src/user_management/mod.rs +++ b/src/user_management/mod.rs @@ -23,8 +23,6 @@ mod manager; pub use manager::UserManager; pub use user::User; pub use manager::CertificateData; -use crate::types::Request; -use user::{NotSignedInUser, SignedInUser}; #[derive(Debug)] pub enum UserManagerError { diff --git a/src/user_management/user.rs b/src/user_management/user.rs index 13ee056..7d4be89 100644 --- a/src/user_management/user.rs +++ b/src/user_management/user.rs @@ -42,13 +42,13 @@ impl PartialUser { /// A list of certificate hashes registered to this user /// /// Can be looked up using [`UserManager::lookup_certificate()`] to get full information - pub fn certificates(&self) -> &Vec { + pub const fn certificates(&self) -> &Vec { &self.certificates } /// The bcrypt hash of the user's password pub fn pass_hash(&self) -> Option<&str> { - self.pass_hash.as_ref().map(|s| s.as_str()) + self.pass_hash.as_deref() } /// Write user data to the database