Cleaned up some warnings in user_management
*sweep sweep sweep sweep sweep*
This commit is contained in:
parent
18228bb1c5
commit
abcb296574
|
@ -71,7 +71,7 @@ impl UserManager {
|
||||||
/// # Errors
|
/// # Errors
|
||||||
/// An error is thrown if there is an error reading from the database or if data
|
/// An error is thrown if there is an error reading from the database or if data
|
||||||
/// recieved from the database is corrupt
|
/// recieved from the database is corrupt
|
||||||
pub fn lookup_user<'de, UserData>(
|
pub fn lookup_user<UserData>(
|
||||||
&self,
|
&self,
|
||||||
username: impl AsRef<[u8]>
|
username: impl AsRef<[u8]>
|
||||||
) -> Result<Option<PartialUser<UserData>>>
|
) -> Result<Option<PartialUser<UserData>>>
|
||||||
|
@ -93,7 +93,7 @@ impl UserManager {
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
/// Pancis if the database is corrupt
|
/// Pancis if the database is corrupt
|
||||||
pub fn get_user<'de, UserData>(
|
pub fn get_user<UserData>(
|
||||||
&self,
|
&self,
|
||||||
cert: Option<&Certificate>
|
cert: Option<&Certificate>
|
||||||
) -> Result<User<UserData>>
|
) -> Result<User<UserData>>
|
||||||
|
|
|
@ -23,8 +23,6 @@ mod manager;
|
||||||
pub use manager::UserManager;
|
pub use manager::UserManager;
|
||||||
pub use user::User;
|
pub use user::User;
|
||||||
pub use manager::CertificateData;
|
pub use manager::CertificateData;
|
||||||
use crate::types::Request;
|
|
||||||
use user::{NotSignedInUser, SignedInUser};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum UserManagerError {
|
pub enum UserManagerError {
|
||||||
|
|
|
@ -42,13 +42,13 @@ impl<UserData> PartialUser<UserData> {
|
||||||
/// A list of certificate hashes registered to this user
|
/// A list of certificate hashes registered to this user
|
||||||
///
|
///
|
||||||
/// Can be looked up using [`UserManager::lookup_certificate()`] to get full information
|
/// 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
|
&self.certificates
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The bcrypt hash of the user's password
|
/// The bcrypt hash of the user's password
|
||||||
pub fn pass_hash(&self) -> Option<&str> {
|
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
|
/// Write user data to the database
|
||||||
|
|
Loading…
Reference in a new issue