Skip to content

Commit

Permalink
Change generic definition of Catcher functions (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn authored Aug 16, 2024
1 parent 94c3f6f commit 196e68b
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions crates/core/src/catcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ impl Default for Catcher {
}
impl Catcher {
/// Create new `Catcher`.
pub fn new<H: Into<Arc<dyn Handler>>>(goal: H) -> Self {
pub fn new<H: Handler>(goal: H) -> Self {
Catcher {
goal: goal.into(),
goal: Arc::new(goal),
hoops: vec![],
}
}
Expand Down Expand Up @@ -114,15 +114,6 @@ impl Catcher {
}
}

impl<H> From<H> for Catcher
where
H: Into<Arc<dyn Handler>>,
{
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,
Expand Down

0 comments on commit 196e68b

Please sign in to comment.