diff --git a/src/handler/adapters.rs b/src/handler/adapters.rs index 04f66ec..78fb735 100644 --- a/src/handler/adapters.rs +++ b/src/handler/adapters.rs @@ -30,9 +30,9 @@ pub trait HandlerExt: HandlerFor + Sized { fn with_custom_display_fn( self, display: F, - ) -> CustomDisplayFn + ) -> CustomDisplayFn where - F: Fn(HandlerArgsFor, Self::Ok) -> Result<(), Self::Err>; + F: Fn(HandlerArgsFor, Self::Ok) -> Result<(), Self::Err>; fn with_inherited( self, f: F, @@ -64,12 +64,9 @@ impl + Sized> HandlerExt( - self, - display: F, - ) -> CustomDisplayFn + fn with_custom_display_fn(self, display: F) -> CustomDisplayFn where - F: Fn(HandlerArgsFor, Self::Ok) -> Result<(), Self::Err>, + F: Fn(HandlerArgsFor, Self::Ok) -> Result<(), Self::Err>, { CustomDisplayFn { _phantom: PhantomData::new(), diff --git a/tests/handler.rs b/tests/handler.rs index 1a0d9cf..7128ba2 100644 --- a/tests/handler.rs +++ b/tests/handler.rs @@ -129,6 +129,7 @@ fn make_api() -> ParentHandler { )) }, ) + .with_custom_display_fn(|_, a| Ok(println!("{a}"))) .with_call_remote::(), ) .subcommand(