Move the EventHandler from the client to the proc macro
This commit is contained in:
parent
789455668c
commit
21efb88331
2 changed files with 3 additions and 3 deletions
|
@ -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()
|
||||
|
|
|
@ -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 {
|
||||
|
|
Reference in a new issue