Skip to content

Commit

Permalink
chore(core): remove redundance bounds on Resources
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Jan 1, 2024
1 parent 5871e9b commit 8bb187d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions viz-router/src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Resources {
pub(crate) fn on<H, O>(mut self, kind: Kind, method: Method, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
match self
.routes
Expand All @@ -95,7 +95,7 @@ impl Resources {
pub fn index<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Empty, Method::GET, handler)
}
Expand All @@ -105,7 +105,7 @@ impl Resources {
pub fn new<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::New, Method::GET, handler)
}
Expand All @@ -115,7 +115,7 @@ impl Resources {
pub fn create<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Empty, Method::POST, handler)
}
Expand All @@ -125,7 +125,7 @@ impl Resources {
pub fn show<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Id, Method::GET, handler)
}
Expand All @@ -135,7 +135,7 @@ impl Resources {
pub fn edit<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Edit, Method::GET, handler)
}
Expand All @@ -145,7 +145,7 @@ impl Resources {
pub fn update<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Id, Method::PUT, handler)
}
Expand All @@ -155,7 +155,7 @@ impl Resources {
pub fn update_with_patch<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Id, Method::PATCH, handler)
}
Expand All @@ -165,7 +165,7 @@ impl Resources {
pub fn destroy<H, O>(self, handler: H) -> Self
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
O: IntoResponse,
{
self.on(Kind::Id, Method::DELETE, handler)
}
Expand Down Expand Up @@ -288,7 +288,7 @@ mod tests {
#[async_trait]
impl<H> Handler<Request> for LoggerHandler<H>
where
H: Handler<Request> + Send + Clone + 'static,
H: Handler<Request>,
{
type Output = H::Output;

Expand All @@ -307,8 +307,8 @@ mod tests {

async fn around<H, O>((req, handler): Next<Request, H>) -> Result<Response>
where
H: Handler<Request, Output = Result<O>> + Clone,
O: IntoResponse + Send + 'static,
H: Handler<Request, Output = Result<O>>,
O: IntoResponse,
{
handler.call(req).await.map(IntoResponse::into_response)
}
Expand Down

0 comments on commit 8bb187d

Please sign in to comment.