From 21efb88331519930c81abc1b16a5da90234d1656 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Sun, 6 Jan 2019 15:45:58 +0100 Subject: [PATCH] Move the EventHandler from the client to the proc macro --- opensmtpd-derive/src/lib.rs | 4 ++-- opensmtpd/examples/dummy.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opensmtpd-derive/src/lib.rs b/opensmtpd-derive/src/lib.rs index 2c95cb1..112e7b2 100644 --- a/opensmtpd-derive/src/lib.rs +++ b/opensmtpd-derive/src/lib.rs @@ -13,8 +13,8 @@ pub fn event(attr: TokenStream, input: TokenStream) -> TokenStream { let fn_body = &item.block; let fn_output = &item.decl.output; let output = quote! { - fn #fn_name() -> EventHandler { - EventHandler::new(#attr.to_string(), |#fn_params| #fn_output #fn_body) + fn #fn_name() -> opensmtpd::EventHandler { + opensmtpd::EventHandler::new(#attr.to_string(), |#fn_params| #fn_output #fn_body) } }; output.into() diff --git a/opensmtpd/examples/dummy.rs b/opensmtpd/examples/dummy.rs index e38185e..e8a4908 100644 --- a/opensmtpd/examples/dummy.rs +++ b/opensmtpd/examples/dummy.rs @@ -1,6 +1,6 @@ use env_logger::{Builder, Env}; use log::{debug, info}; -use opensmtpd::{event, handlers, Entry, EventHandler, SmtpIn}; +use opensmtpd::{event, handlers, Entry, SmtpIn}; #[event(Any)] fn on_event(entry: &Entry) -> bool {