From 3df960f8be4b3c6307e48c4176b7c1e5d686b829 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Thu, 4 Jan 2024 14:52:09 -0700 Subject: [PATCH] remove debug requirement --- rpc-toolkit/src/handler/adapters.rs | 12 +++--------- rpc-toolkit/src/handler/mod.rs | 6 +++--- rpc-toolkit/src/handler/parent.rs | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/rpc-toolkit/src/handler/adapters.rs b/rpc-toolkit/src/handler/adapters.rs index 1b08329..b4a8924 100644 --- a/rpc-toolkit/src/handler/adapters.rs +++ b/rpc-toolkit/src/handler/adapters.rs @@ -240,7 +240,7 @@ where impl Handler for CustomDisplay where H: Handler, - P: Send + Sync + Clone + Debug + 'static, + P: Send + Sync + Clone + 'static, { type Context = H::Context; fn handle_sync( @@ -311,7 +311,6 @@ where > + Send + Sync + Clone - + Debug + 'static, { type Context = P::Context; @@ -393,7 +392,7 @@ impl Handler for CustomDisplayFn where Context: Send + Sync + 'static, H: Handler, - F: Send + Sync + Clone + Debug + 'static, + F: Send + Sync + Clone + 'static, { type Context = H::Context; fn handle_sync( @@ -456,12 +455,7 @@ impl CliBindings for CustomDisplayFn where Context: IntoContext, H: CliBindings, - F: Fn(HandleArgs, H::Ok) -> Result<(), H::Err> - + Send - + Sync - + Clone - + Debug - + 'static, + F: Fn(HandleArgs, H::Ok) -> Result<(), H::Err> + Send + Sync + Clone + 'static, { type Context = Context; fn cli_command(&self, ctx_ty: TypeId) -> clap::Command { diff --git a/rpc-toolkit/src/handler/mod.rs b/rpc-toolkit/src/handler/mod.rs index 36a898e..d4e58ed 100644 --- a/rpc-toolkit/src/handler/mod.rs +++ b/rpc-toolkit/src/handler/mod.rs @@ -55,7 +55,7 @@ impl HandleAnyArgs { } #[async_trait::async_trait] -pub(crate) trait HandleAny: std::fmt::Debug + Send + Sync { +pub(crate) trait HandleAny: Send + Sync { fn handle_sync(&self, handle_args: HandleAnyArgs) -> Result; async fn handle_async(&self, handle_args: HandleAnyArgs) -> Result; fn metadata( @@ -122,7 +122,7 @@ pub trait PrintCliResult: HandlerTypes { pub(crate) trait HandleAnyWithCli: HandleAny + CliBindingsAny {} impl HandleAnyWithCli for T {} -#[derive(Debug, Clone)] +#[derive(Clone)] #[allow(private_interfaces)] pub enum DynHandler { WithoutCli(Arc), @@ -178,7 +178,7 @@ pub trait HandlerTypes { } #[async_trait::async_trait] -pub trait Handler: HandlerTypes + std::fmt::Debug + Clone + Send + Sync + 'static { +pub trait Handler: HandlerTypes + Clone + Send + Sync + 'static { type Context: IntoContext; fn handle_sync( &self, diff --git a/rpc-toolkit/src/handler/parent.rs b/rpc-toolkit/src/handler/parent.rs index d137a94..e5b8bbb 100644 --- a/rpc-toolkit/src/handler/parent.rs +++ b/rpc-toolkit/src/handler/parent.rs @@ -67,7 +67,7 @@ impl<'a> std::borrow::Borrow> for Name { } } -#[derive(Debug, Clone)] +#[derive(Clone)] pub(crate) struct SubcommandMap(pub(crate) OrdMap, DynHandler>>); impl SubcommandMap { fn insert( @@ -125,7 +125,7 @@ impl Clone for ParentHandler { impl std::fmt::Debug for ParentHandler { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_tuple("ParentHandler") - .field(&self.subcommands) + // .field(&self.subcommands) .finish() } }