go through a ton of pedantic clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
33727a3423
commit
e2c7afe69c
61 changed files with 282 additions and 247 deletions
|
@ -48,10 +48,10 @@ impl Service {
|
|||
auth: &AuthData,
|
||||
uiaainfo: &UiaaInfo,
|
||||
) -> Result<(bool, UiaaInfo)> {
|
||||
let mut uiaainfo = auth
|
||||
.session()
|
||||
.map(|session| self.db.get_uiaa_session(user_id, device_id, session))
|
||||
.unwrap_or_else(|| Ok(uiaainfo.clone()))?;
|
||||
let mut uiaainfo = auth.session().map_or_else(
|
||||
|| Ok(uiaainfo.clone()),
|
||||
|session| self.db.get_uiaa_session(user_id, device_id, session),
|
||||
)?;
|
||||
|
||||
if uiaainfo.session.is_none() {
|
||||
uiaainfo.session = Some(utils::random_string(SESSION_ID_LENGTH));
|
||||
|
@ -64,14 +64,11 @@ impl Service {
|
|||
password,
|
||||
..
|
||||
}) => {
|
||||
let username = match identifier {
|
||||
UserIdentifier::UserIdOrLocalpart(username) => username,
|
||||
_ => {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Unrecognized,
|
||||
"Identifier type not recognized.",
|
||||
))
|
||||
}
|
||||
let UserIdentifier::UserIdOrLocalpart(username) = identifier else {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Unrecognized,
|
||||
"Identifier type not recognized.",
|
||||
));
|
||||
};
|
||||
|
||||
let user_id = UserId::parse_with_server_name(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue