From 2a640a90d455cf7c380a591b5ab1fcd36641b212 Mon Sep 17 00:00:00 2001 From: Philipp Korber Date: Fri, 16 Nov 2018 18:11:33 +0100 Subject: refactor(mail/deps) now reexports `headers` instead of redefining it --- mail/src/lib.rs | 3 --- mail/src/macros.rs | 33 --------------------------------- 2 files changed, 36 deletions(-) delete mode 100644 mail/src/macros.rs diff --git a/mail/src/lib.rs b/mail/src/lib.rs index e799516..56fe2c2 100644 --- a/mail/src/lib.rs +++ b/mail/src/lib.rs @@ -99,7 +99,6 @@ extern crate mail_internals; #[allow(unused_imports)] -#[macro_use] extern crate mail_headers; pub extern crate mail_core as mail; //pub extern crate mail_template as template; @@ -164,8 +163,6 @@ pub use mail_headers::{ #[doc(hidden)] pub use mail_headers::data; -pub mod macros; - /// Re-export of the default_impl parts from both `mail-core` and `mail-template`. /// /// This provides default implementations for a number of traits which might be needed diff --git a/mail/src/macros.rs b/mail/src/macros.rs deleted file mode 100644 index 0603ebc..0000000 --- a/mail/src/macros.rs +++ /dev/null @@ -1,33 +0,0 @@ -//FIXE[rustc/macro reexport] re-export the macro once possible in stable -// currently this won't work well so this is just a copy of the macro in -// mail-headers ;=( -/// Create a header map from a list of header's with ther fields -/// -/// # Example -/// -/// ``` -/// # #[macro_use] -/// # extern crate mail_headers; -/// # use mail_headers::headers::*; -/// # use mail_headers::error::ComponentCreationError; -/// # fn main() { (|| -> Result<(), ComponentCreationError> { -/// let map = headers! { -/// _From: ["bobo@nana.test"], -/// Subject: "hy there" -/// }?; -/// # Ok(()) })(); } -/// ``` -#[macro_export] -macro_rules! headers { - ($($header:ty : $val:expr),*) => ({ - //FIXME[rust/catch block] use catch block once available - (|| -> Result<$crate::HeaderMap, ::mail::error::ComponentCreationError> - { - let mut map = ::mail::HeaderMap::new(); - $( - map.insert(<$header as ::mail::HeaderKind>::body($val)?); - )* - Ok(map) - })() - }); -} \ No newline at end of file -- cgit v1.2.3