diff options
author | Daniel García <[email protected]> | 2020-05-03 17:24:51 +0200 |
---|---|---|
committer | Daniel García <[email protected]> | 2020-05-03 17:24:51 +0200 |
commit | 9cca64003aa7fd8e3532d20c18bba6fd9de11eb3 (patch) | |
tree | a59e317fcbe242421917dc3ad3756dfec7f5b4dc /src/mail.rs | |
parent | 0de52c6c99737cb1ee0c33c138ccedd7ed955fd5 (diff) | |
download | vaultwarden-9cca64003aa7fd8e3532d20c18bba6fd9de11eb3.tar.gz vaultwarden-9cca64003aa7fd8e3532d20c18bba6fd9de11eb3.zip |
Remove unused dependency and simple feature, update dependencies and fix some clippy lints
Diffstat (limited to 'src/mail.rs')
-rw-r--r-- | src/mail.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mail.rs b/src/mail.rs index 2878ed83..c25e31e7 100644 --- a/src/mail.rs +++ b/src/mail.rs @@ -46,7 +46,7 @@ fn mailer() -> SmtpTransport { let smtp_client = match CONFIG.smtp_auth_mechanism() { Some(mechanism) => { - let correct_mechanism = format!("\"{}\"", crate::util::upcase_first(&mechanism.trim_matches('"'))); + let correct_mechanism = format!("\"{}\"", crate::util::upcase_first(mechanism.trim_matches('"'))); match serde_json::from_str::<SmtpAuthMechanism>(&correct_mechanism) { Ok(auth_mechanism) => smtp_client.authentication_mechanism(auth_mechanism), @@ -95,7 +95,7 @@ pub fn send_password_hint(address: &str, hint: Option<String>) -> EmptyResult { let (subject, body_html, body_text) = get_text(template_name, json!({ "hint": hint, "url": CONFIG.domain() }))?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_delete_account(address: &str, uuid: &str) -> EmptyResult { @@ -112,7 +112,7 @@ pub fn send_delete_account(address: &str, uuid: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_verify_email(address: &str, uuid: &str) -> EmptyResult { @@ -129,7 +129,7 @@ pub fn send_verify_email(address: &str, uuid: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_welcome(address: &str) -> EmptyResult { @@ -140,7 +140,7 @@ pub fn send_welcome(address: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_welcome_must_verify(address: &str, uuid: &str) -> EmptyResult { @@ -156,7 +156,7 @@ pub fn send_welcome_must_verify(address: &str, uuid: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_invite( @@ -188,7 +188,7 @@ pub fn send_invite( }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_invite_accepted(new_user_email: &str, address: &str, org_name: &str) -> EmptyResult { @@ -201,7 +201,7 @@ pub fn send_invite_accepted(new_user_email: &str, address: &str, org_name: &str) }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_invite_confirmed(address: &str, org_name: &str) -> EmptyResult { @@ -213,7 +213,7 @@ pub fn send_invite_confirmed(address: &str, org_name: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_new_device_logged_in(address: &str, ip: &str, dt: &NaiveDateTime, device: &str) -> EmptyResult { @@ -232,7 +232,7 @@ pub fn send_new_device_logged_in(address: &str, ip: &str, dt: &NaiveDateTime, de }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_token(address: &str, token: &str) -> EmptyResult { @@ -244,7 +244,7 @@ pub fn send_token(address: &str, token: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_change_email(address: &str, token: &str) -> EmptyResult { @@ -256,7 +256,7 @@ pub fn send_change_email(address: &str, token: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } pub fn send_test(address: &str) -> EmptyResult { @@ -267,7 +267,7 @@ pub fn send_test(address: &str) -> EmptyResult { }), )?; - send_email(&address, &subject, &body_html, &body_text) + send_email(address, &subject, &body_html, &body_text) } fn send_email(address: &str, subject: &str, body_html: &str, body_text: &str) -> EmptyResult { |