diff --git a/src/email_client.rs b/src/email_client.rs index ac125c1..e97fc2e 100644 --- a/src/email_client.rs +++ b/src/email_client.rs @@ -32,11 +32,11 @@ impl EmailClient { .and_then(|path| path.join("email")) .unwrap(); let request_body = SendEmailRequest { - from: self.sender.as_ref().to_owned(), - to: recipient.as_ref().to_owned(), - subject: subject.to_owned(), - html_body: html_content.to_owned(), - text_body: text_content.to_owned(), + from: self.sender.as_ref(), + to: recipient.as_ref(), + subject, + html_body: html_content, + text_body: text_content, }; let builder = self .http_client @@ -51,12 +51,12 @@ impl EmailClient { #[derive(Serialize)] #[serde(rename_all = "PascalCase")] -struct SendEmailRequest { - from: String, - to: String, - subject: String, - html_body: String, - text_body: String, +struct SendEmailRequest<'a> { + from: &'a str, + to: &'a str, + subject: &'a str, + html_body: &'a str, + text_body: &'a str, } #[cfg(test)]