From 48d049d4bf9744e8981c1c15b48ac3eea888a595 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 21 Sep 2020 10:03:48 +0200 Subject: [PATCH] proxmox/src/tools/email.rs: use slice instead of Vec --- proxmox/src/tools/email.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proxmox/src/tools/email.rs b/proxmox/src/tools/email.rs index 031baa20..b5d42c49 100644 --- a/proxmox/src/tools/email.rs +++ b/proxmox/src/tools/email.rs @@ -9,7 +9,7 @@ use std::process::{Command, Stdio}; /// /// ``sendmail`` is used for sending the mail. pub fn sendmail( - mailto: Vec<&str>, + mailto: &[&str], subject: &str, text: Option<&str>, html: Option<&str>, @@ -22,7 +22,7 @@ pub fn sendmail( bail!("At least one recipient has to be specified!") } - for recipient in &mailto { + for recipient in mailto { if !mail_regex.is_match(recipient) { bail!("'{}' is not a valid email address", recipient) } @@ -128,7 +128,7 @@ mod test { #[test] fn test1() { let result = sendmail( - vec!["somenotvalidemail!", "somealmostvalid email"], + &["somenotvalidemail!", "somealmostvalid email"], "Subject1", Some("TEXT"), Some("HTML"), @@ -141,7 +141,7 @@ mod test { #[test] fn test2() { let result = sendmail( - vec![], + &[], "Subject2", None, Some("HTML"), @@ -154,7 +154,7 @@ mod test { #[test] fn test3() { let result = sendmail( - vec!["a@b.c"], + &["a@b.c"], "Subject3", None, Some("HTML"),