From 066bb286d4f092a7b66bd52ec0955ed3dfb19524 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Thu, 29 Aug 2024 02:51:49 +0300 Subject: [PATCH] fix macro pin_handler visibility --- src/ezhttp/handler.rs | 3 +-- src/ezhttp/mod.rs | 1 - src/ezhttp/starter.rs | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ezhttp/handler.rs b/src/ezhttp/handler.rs index de70a42..d6462a2 100644 --- a/src/ezhttp/handler.rs +++ b/src/ezhttp/handler.rs @@ -42,14 +42,13 @@ pub async fn handler_connection( } } +#[macro_export] macro_rules! pin_handler { ($handler: expr) => { Box::new(move |a, b| Box::pin($handler(a, b))) }; } -pub(crate) use pin_handler; - #[cfg(feature = "http_rrs")] /// HTTP_RRS handler pub async fn handler_http_rrs( diff --git a/src/ezhttp/mod.rs b/src/ezhttp/mod.rs index 397a9dd..9a17643 100644 --- a/src/ezhttp/mod.rs +++ b/src/ezhttp/mod.rs @@ -28,7 +28,6 @@ pub use starter::*; pub use handler::*; - async fn read_line(data: &mut (impl AsyncReadExt + Unpin)) -> Result { let mut line = Vec::new(); loop { diff --git a/src/ezhttp/starter.rs b/src/ezhttp/starter.rs index ddaf260..decc285 100644 --- a/src/ezhttp/starter.rs +++ b/src/ezhttp/starter.rs @@ -1,8 +1,9 @@ use tokio::task::JoinHandle; use super::{ - handler_connection, pin_handler, start_server_new_thread, start_server_sync, start_server_with_threadpool, Handler, HttpServer + handler_connection, start_server_new_thread, start_server_sync, start_server_with_threadpool, Handler, HttpServer }; +use crate::pin_handler; use std::{ error::Error, sync::{