We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
match
ok_or_else()
1 parent d8b2aad commit cb19848Copy full SHA for cb19848
src/worker/jobs/expiry_notification.rs
@@ -59,10 +59,9 @@ fn handle_expiring_token(
59
emails: &Emails,
60
) -> Result<(), anyhow::Error> {
61
let user = User::find(conn, token.user_id)?;
62
- let recipient = match user.email(conn)? {
63
- Some(email) => email,
64
- None => return Err(anyhow!("No address found")),
65
- };
+ let recipient = user
+ .email(conn)?
+ .ok_or_else(|| anyhow!("No address found"))?;
66
let email = ExpiryNotificationEmail {
67
name: &user.gh_login,
68
token_name: &token.name,
0 commit comments