feat(email): Upgrade mime crate to 0.3

This commit is contained in:
Alexis Mousset
2017-06-14 20:28:05 +02:00
parent 0c1b440f8b
commit 912e0579a6
3 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ travis-ci = { repository = "lettre/lettre_email" }
[dependencies]
email = "^0.0"
mime = "^0.2"
mime = "^0.3"
time = "^0.1"
uuid = { version = ">=0.4, <0.6", features = ["v4"] }
lettre = { path = "../lettre" }

View File

@@ -3,6 +3,7 @@
use email_format::{Address, Header, Mailbox, MimeMessage, MimeMultipartType};
use error::Error;
use lettre::SendableEmail;
use mime;
use mime::Mime;
use std::fmt;
use std::fmt::{Display, Formatter};
@@ -554,7 +555,7 @@ impl EmailBuilder {
pub fn set_text<S: Into<String>>(&mut self, body: S) {
self.message.set_body(body);
self.message
.add_header(("Content-Type", format!("{}", mime!(Text/Plain; Charset=Utf8)).as_ref()));
.add_header(("Content-Type", format!("{}", mime::TEXT_PLAIN_UTF_8).as_ref()));
}
/// Sets the email body to HTML content
@@ -567,7 +568,7 @@ impl EmailBuilder {
pub fn set_html<S: Into<String>>(&mut self, body: S) {
self.message.set_body(body);
self.message
.add_header(("Content-Type", format!("{}", mime!(Text/Html; Charset=Utf8)).as_ref()));
.add_header(("Content-Type", format!("{}", mime::TEXT_HTML).as_ref()));
}
/// Sets the email content
@@ -588,12 +589,12 @@ impl EmailBuilder {
let text = PartBuilder::new()
.body(body_text)
.header(("Content-Type", format!("{}", mime!(Text/Plain; Charset=Utf8)).as_ref()))
.header(("Content-Type", format!("{}", mime::TEXT_PLAIN_UTF_8).as_ref()))
.build();
let html = PartBuilder::new()
.body(body_html)
.header(("Content-Type", format!("{}", mime!(Text/Html; Charset=Utf8)).as_ref()))
.header(("Content-Type", format!("{}", mime::TEXT_HTML).as_ref()))
.build();
alternate.add_child(text);

View File

@@ -54,7 +54,6 @@
#![deny(missing_docs, unsafe_code, unstable_features, warnings, missing_debug_implementations)]
#[macro_use]
extern crate mime;
extern crate time;
extern crate uuid;