diff options
author | Mathijs van Veluw <[email protected]> | 2024-12-14 00:55:34 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-14 00:55:34 +0100 |
commit | 9cd400db6c5da858a4f49eb883469cbd6cb7337d (patch) | |
tree | 1c1d1900c1e1ba20da64e4c2052285b2d81317e8 /src/mail.rs | |
parent | fd512300448995735961cbeedcbe4b684be1c5fd (diff) | |
download | vaultwarden-9cd400db6c5da858a4f49eb883469cbd6cb7337d.tar.gz vaultwarden-9cd400db6c5da858a4f49eb883469cbd6cb7337d.zip |
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 <[email protected]>
Diffstat (limited to 'src/mail.rs')
-rw-r--r-- | src/mail.rs | 10 |
1 files changed, 4 insertions, 6 deletions
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( |