From 0603928164ce2862b9bdd6021f371a6151ad8688 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Fri, 3 May 2024 23:43:27 -0600 Subject: [PATCH] remove requirement for type args on subcommand --- src/handler/adapters.rs | 13 ++++++------- tests/handler.rs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/handler/adapters.rs b/src/handler/adapters.rs index 78fb735..00a49ca 100644 --- a/src/handler/adapters.rs +++ b/src/handler/adapters.rs @@ -590,13 +590,12 @@ impl Debug for RemoteCaller Handler - for WithContext> +impl Handler + for WithContext> where - Context: crate::Context, - LocalContext: crate::Context + CallRemote, + Context: crate::Context + CallRemote, RemoteContext: crate::Context, - H: HandlerFor + CliBindings, + H: HandlerFor + CliBindings, H::Ok: Serialize + DeserializeOwned, H::Err: From, H::Params: Serialize + DeserializeOwned, @@ -608,8 +607,8 @@ where fn handler_for(self) -> Option> { if TypeId::of::() == TypeId::of::() { DynHandler::new(self.handler.handler.no_cli()) - } else if TypeId::of::() == TypeId::of::() { - DynHandler::new(CallRemoteHandler::::new( + } else if TypeId::of::() == TypeId::of::() { + DynHandler::new(CallRemoteHandler::::new( self.handler.handler, )) } else { diff --git a/tests/handler.rs b/tests/handler.rs index 7128ba2..4e2ce12 100644 --- a/tests/handler.rs +++ b/tests/handler.rs @@ -119,7 +119,7 @@ fn make_api() -> ParentHandler { donde: String, } ParentHandler::::new() - .subcommand::( + .subcommand( "echo", from_fn_async( |c: ServerContext, EchoParams { next }: EchoParams| async move {