From 42c70e615ce356fed59f4e152aa4e5226b980d62 Mon Sep 17 00:00:00 2001 From: Chip Senkbeil Date: Sat, 4 Nov 2023 20:01:06 -0500 Subject: [PATCH] Remove BoxedXXXHandler types --- distant-plugin/src/handlers.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/distant-plugin/src/handlers.rs b/distant-plugin/src/handlers.rs index 0fa85a8..f1b8ec8 100644 --- a/distant-plugin/src/handlers.rs +++ b/distant-plugin/src/handlers.rs @@ -7,12 +7,6 @@ use distant_core_auth::Authenticator; use crate::client::Client; use crate::common::{Destination, Map}; -/// Boxed [`LaunchHandler`]. -pub type BoxedLaunchHandler = Box; - -/// Boxed [`ConnectHandler`]. -pub type BoxedConnectHandler = Box; - /// Interface for a handler to launch a server, returning the destination to the server. #[async_trait] pub trait LaunchHandler: Send + Sync { @@ -67,7 +61,7 @@ where #[macro_export] macro_rules! boxed_launch_handler { (|$destination:ident, $options:ident, $authenticator:ident| $(async)? $body:block) => {{ - let x: $crate::handlers::BoxedLaunchHandler = Box::new( + let x: Box = Box::new( |$destination: &$crate::common::Destination, $options: &$crate::common::Map, $authenticator: &mut dyn $crate::auth::Authenticator| async { $body }, @@ -75,7 +69,7 @@ macro_rules! boxed_launch_handler { x }}; (move |$destination:ident, $options:ident, $authenticator:ident| $(async)? $body:block) => {{ - let x: $crate::handlers::BoxedLaunchHandler = Box::new( + let x: Box = Box::new( move |$destination: &$crate::common::Destination, $options: &$crate::common::Map, $authenticator: &mut dyn $crate::auth::Authenticator| async move { $body }, @@ -138,7 +132,7 @@ where #[macro_export] macro_rules! boxed_connect_handler { (|$destination:ident, $options:ident, $authenticator:ident| $(async)? $body:block) => {{ - let x: $crate::handlers::BoxedConnectHandler = Box::new( + let x: Box = Box::new( |$destination: &$crate::common::Destination, $options: &$crate::common::Map, $authenticator: &mut dyn $crate::auth::Authenticator| async { $body }, @@ -146,7 +140,7 @@ macro_rules! boxed_connect_handler { x }}; (move |$destination:ident, $options:ident, $authenticator:ident| $(async)? $body:block) => {{ - let x: $crate::handlers::BoxedConnectHandler = Box::new( + let x: Box = Box::new( move |$destination: &$crate::common::Destination, $options: &$crate::common::Map, $authenticator: &mut dyn $crate::auth::Authenticator| async move { $body },