mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 09:16:32 +03:00
refactor: flatten handle_auth_require() with let..else
This commit is contained in:
@@ -82,8 +82,11 @@ pub(super) async fn handle_auth_required(
|
||||
context: &Context,
|
||||
message: &MimeMessage,
|
||||
) -> Result<HandshakeMessage> {
|
||||
match BobState::from_db(&context.sql).await? {
|
||||
Some(mut bobstate) => match bobstate.handle_message(context, message).await? {
|
||||
let Some(mut bobstate) = BobState::from_db(&context.sql).await? else {
|
||||
return Ok(HandshakeMessage::Ignore);
|
||||
};
|
||||
|
||||
match bobstate.handle_message(context, message).await? {
|
||||
Some(BobHandshakeStage::Terminated(why)) => {
|
||||
bobstate.notify_aborted(context, why).await?;
|
||||
Ok(HandshakeMessage::Done)
|
||||
@@ -101,8 +104,6 @@ pub(super) async fn handle_auth_required(
|
||||
Ok(HandshakeMessage::Done)
|
||||
}
|
||||
None => Ok(HandshakeMessage::Ignore),
|
||||
},
|
||||
None => Ok(HandshakeMessage::Ignore),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user