Cleaned up some warnings in user_management

*sweep sweep sweep sweep sweep*
This commit is contained in:
Emi Tatsuo 2020-11-19 14:27:36 -05:00
parent 18228bb1c5
commit abcb296574
Signed by: Emi
GPG Key ID: 68FAB2E2E6DFC98B
3 changed files with 4 additions and 6 deletions

View File

@ -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<UserData>(
&self,
username: impl AsRef<[u8]>
) -> Result<Option<PartialUser<UserData>>>
@ -93,7 +93,7 @@ impl UserManager {
///
/// # Panics
/// Pancis if the database is corrupt
pub fn get_user<'de, UserData>(
pub fn get_user<UserData>(
&self,
cert: Option<&Certificate>
) -> Result<User<UserData>>

View File

@ -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 {

View File

@ -42,13 +42,13 @@ impl<UserData> PartialUser<UserData> {
/// 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<u32> {
pub const fn certificates(&self) -> &Vec<u32> {
&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