Use if let more

This commit is contained in:
Jake Howard
2021-03-27 14:03:31 +00:00
parent ea57dc3bc9
commit a8138be69b
3 changed files with 17 additions and 15 deletions

View File

@ -139,10 +139,8 @@ fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult {
}
user.last_verifying_at = Some(user.created_at);
} else {
if let Err(e) = mail::send_welcome(&user.email) {
error!("Error sending welcome email: {:#?}", e);
}
} else if let Err(e) = mail::send_welcome(&user.email) {
error!("Error sending welcome email: {:#?}", e);
}
}