From 9cd400db6c5da858a4f49eb883469cbd6cb7337d Mon Sep 17 00:00:00 2001 From: Mathijs van Veluw Date: Sat, 14 Dec 2024 00:55:34 +0100 Subject: Some refactoring and optimizations (#5291) - Refactored several code to use more modern syntax - Made some checks a bit more strict - Updated crates Signed-off-by: BlackDex --- src/mail.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mail.rs') diff --git a/src/mail.rs b/src/mail.rs index 5ce4a079..1a32ae25 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -286,9 +286,8 @@ pub async fn send_invite( } } - let query_string = match query.query() { - None => err!("Failed to build invite URL query parameters"), - Some(query) => query, + let Some(query_string) = query.query() else { + err!("Failed to build invite URL query parameters") }; let (subject, body_html, body_text) = get_text( @@ -330,9 +329,8 @@ pub async fn send_emergency_access_invite( .append_pair("token", &encode_jwt(&claims)); } - let query_string = match query.query() { - None => err!("Failed to build emergency invite URL query parameters"), - Some(query) => query, + let Some(query_string) = query.query() else { + err!("Failed to build emergency invite URL query parameters") }; let (subject, body_html, body_text) = get_text( -- cgit v1.2.3