From 196e68be4cf9aa9336f6f49b148cd538e349fb35 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Fri, 16 Aug 2024 23:22:57 +0800 Subject: [PATCH] Change generic definition of Catcher functions (#873) --- crates/core/src/catcher.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/core/src/catcher.rs b/crates/core/src/catcher.rs index d0d960a5a..01d1d74df 100644 --- a/crates/core/src/catcher.rs +++ b/crates/core/src/catcher.rs @@ -69,9 +69,9 @@ impl Default for Catcher { } impl Catcher { /// Create new `Catcher`. - pub fn new>>(goal: H) -> Self { + pub fn new(goal: H) -> Self { Catcher { - goal: goal.into(), + goal: Arc::new(goal), hoops: vec![], } } @@ -114,15 +114,6 @@ impl Catcher { } } -impl From for Catcher -where - H: Into>, -{ - fn from(goal: H) -> Self { - Catcher::new(goal) - } -} - /// Default [`Handler`] used as goal for [`Catcher`]. /// /// If http status is error, and all custom handlers is not catch it and write body,