remove debug requirement

This commit is contained in:
Aiden McClelland
2024-01-04 14:52:09 -07:00
parent b2bb376853
commit 3df960f8be
3 changed files with 8 additions and 14 deletions

View File

@@ -240,7 +240,7 @@ where
impl<P, H> Handler for CustomDisplay<P, H> impl<P, H> Handler for CustomDisplay<P, H>
where where
H: Handler, H: Handler,
P: Send + Sync + Clone + Debug + 'static, P: Send + Sync + Clone + 'static,
{ {
type Context = H::Context; type Context = H::Context;
fn handle_sync( fn handle_sync(
@@ -311,7 +311,6 @@ where
> + Send > + Send
+ Sync + Sync
+ Clone + Clone
+ Debug
+ 'static, + 'static,
{ {
type Context = P::Context; type Context = P::Context;
@@ -393,7 +392,7 @@ impl<Context, F, H> Handler for CustomDisplayFn<Context, F, H>
where where
Context: Send + Sync + 'static, Context: Send + Sync + 'static,
H: Handler, H: Handler,
F: Send + Sync + Clone + Debug + 'static, F: Send + Sync + Clone + 'static,
{ {
type Context = H::Context; type Context = H::Context;
fn handle_sync( fn handle_sync(
@@ -456,12 +455,7 @@ impl<Context, F, H> CliBindings for CustomDisplayFn<Context, F, H>
where where
Context: IntoContext, Context: IntoContext,
H: CliBindings, H: CliBindings,
F: Fn(HandleArgs<Context, H>, H::Ok) -> Result<(), H::Err> F: Fn(HandleArgs<Context, H>, H::Ok) -> Result<(), H::Err> + Send + Sync + Clone + 'static,
+ Send
+ Sync
+ Clone
+ Debug
+ 'static,
{ {
type Context = Context; type Context = Context;
fn cli_command(&self, ctx_ty: TypeId) -> clap::Command { fn cli_command(&self, ctx_ty: TypeId) -> clap::Command {

View File

@@ -55,7 +55,7 @@ impl HandleAnyArgs {
} }
#[async_trait::async_trait] #[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<Value, RpcError>; fn handle_sync(&self, handle_args: HandleAnyArgs) -> Result<Value, RpcError>;
async fn handle_async(&self, handle_args: HandleAnyArgs) -> Result<Value, RpcError>; async fn handle_async(&self, handle_args: HandleAnyArgs) -> Result<Value, RpcError>;
fn metadata( fn metadata(
@@ -122,7 +122,7 @@ pub trait PrintCliResult: HandlerTypes {
pub(crate) trait HandleAnyWithCli: HandleAny + CliBindingsAny {} pub(crate) trait HandleAnyWithCli: HandleAny + CliBindingsAny {}
impl<T: HandleAny + CliBindingsAny> HandleAnyWithCli for T {} impl<T: HandleAny + CliBindingsAny> HandleAnyWithCli for T {}
#[derive(Debug, Clone)] #[derive(Clone)]
#[allow(private_interfaces)] #[allow(private_interfaces)]
pub enum DynHandler { pub enum DynHandler {
WithoutCli(Arc<dyn HandleAny>), WithoutCli(Arc<dyn HandleAny>),
@@ -178,7 +178,7 @@ pub trait HandlerTypes {
} }
#[async_trait::async_trait] #[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; type Context: IntoContext;
fn handle_sync( fn handle_sync(
&self, &self,

View File

@@ -67,7 +67,7 @@ impl<'a> std::borrow::Borrow<Option<&'a str>> for Name {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone)]
pub(crate) struct SubcommandMap(pub(crate) OrdMap<Name, OrdMap<Option<TypeId>, DynHandler>>); pub(crate) struct SubcommandMap(pub(crate) OrdMap<Name, OrdMap<Option<TypeId>, DynHandler>>);
impl SubcommandMap { impl SubcommandMap {
fn insert( fn insert(
@@ -125,7 +125,7 @@ impl<Params, InheritedParams> Clone for ParentHandler<Params, InheritedParams> {
impl<Params, InheritedParams> std::fmt::Debug for ParentHandler<Params, InheritedParams> { impl<Params, InheritedParams> std::fmt::Debug for ParentHandler<Params, InheritedParams> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("ParentHandler") f.debug_tuple("ParentHandler")
.field(&self.subcommands) // .field(&self.subcommands)
.finish() .finish()
} }
} }