remove unnecessary bounds

This commit is contained in:
Ali MJ Al-Nasrawy 2021-12-27 01:18:01 +03:00
parent ac0c4eb684
commit c5512834a8
4 changed files with 6 additions and 16 deletions

View File

@ -3,9 +3,8 @@ use std::future::Future;
use actix_service::{boxed, fn_service}; use actix_service::{boxed, fn_service};
use crate::{ use crate::{
body::MessageBody,
service::{BoxedHttpServiceFactory, ServiceRequest, ServiceResponse}, service::{BoxedHttpServiceFactory, ServiceRequest, ServiceResponse},
BoxError, FromRequest, HttpResponse, Responder, FromRequest, HttpResponse, Responder,
}; };
/// The interface for request handlers. /// The interface for request handlers.
@ -92,8 +91,6 @@ where
Args: FromRequest, Args: FromRequest,
R: Future, R: Future,
R::Output: Responder, R::Output: Responder,
<R::Output as Responder>::Body: MessageBody,
<<R::Output as Responder>::Body as MessageBody>::Error: Into<BoxError>,
{ {
boxed::factory(fn_service(move |req: ServiceRequest| { boxed::factory(fn_service(move |req: ServiceRequest| {
let handler = handler.clone(); let handler = handler.clone();

View File

@ -20,7 +20,7 @@ use crate::{
BoxedHttpService, BoxedHttpServiceFactory, HttpServiceFactory, ServiceRequest, BoxedHttpService, BoxedHttpServiceFactory, HttpServiceFactory, ServiceRequest,
ServiceResponse, ServiceResponse,
}, },
BoxError, Error, FromRequest, HttpResponse, Responder, Error, FromRequest, HttpResponse, Responder,
}; };
/// A collection of [`Route`]s that respond to the same path pattern. /// A collection of [`Route`]s that respond to the same path pattern.
@ -236,8 +236,6 @@ where
Args: FromRequest + 'static, Args: FromRequest + 'static,
R: Future + 'static, R: Future + 'static,
R::Output: Responder + 'static, R::Output: Responder + 'static,
<R::Output as Responder>::Body: MessageBody,
<<R::Output as Responder>::Body as MessageBody>::Error: Into<BoxError>,
{ {
self.routes.push(Route::new().to(handler)); self.routes.push(Route::new().to(handler));
self self

View File

@ -8,11 +8,10 @@ use actix_service::{
use futures_core::future::LocalBoxFuture; use futures_core::future::LocalBoxFuture;
use crate::{ use crate::{
body::MessageBody,
guard::{self, Guard}, guard::{self, Guard},
handler::{handler_service, Handler}, handler::{handler_service, Handler},
service::{BoxedHttpServiceFactory, ServiceRequest, ServiceResponse}, service::{BoxedHttpServiceFactory, ServiceRequest, ServiceResponse},
BoxError, Error, FromRequest, HttpResponse, Responder, Error, FromRequest, HttpResponse, Responder,
}; };
/// A request handler with [guards](guard). /// A request handler with [guards](guard).
@ -182,8 +181,6 @@ impl Route {
Args: FromRequest + 'static, Args: FromRequest + 'static,
R: Future + 'static, R: Future + 'static,
R::Output: Responder + 'static, R::Output: Responder + 'static,
<R::Output as Responder>::Body: MessageBody,
<<R::Output as Responder>::Body as MessageBody>::Error: Into<BoxError>,
{ {
self.service = handler_service(handler); self.service = handler_service(handler);
self self

View File

@ -1,14 +1,14 @@
//! Essentials helper functions and types for application registration. //! Essentials helper functions and types for application registration.
use std::{error::Error as StdError, future::Future}; use std::future::Future;
use actix_http::Method; use actix_http::Method;
use actix_router::IntoPatterns; use actix_router::IntoPatterns;
pub use bytes::{Buf, BufMut, Bytes, BytesMut}; pub use bytes::{Buf, BufMut, Bytes, BytesMut};
use crate::{ use crate::{
body::MessageBody, error::BlockingError, extract::FromRequest, handler::Handler, error::BlockingError, extract::FromRequest, handler::Handler, resource::Resource,
resource::Resource, route::Route, scope::Scope, service::WebService, Responder, route::Route, scope::Scope, service::WebService, Responder,
}; };
pub use crate::config::ServiceConfig; pub use crate::config::ServiceConfig;
@ -152,8 +152,6 @@ where
Args: FromRequest + 'static, Args: FromRequest + 'static,
R: Future + 'static, R: Future + 'static,
R::Output: Responder + 'static, R::Output: Responder + 'static,
<R::Output as Responder>::Body: MessageBody + 'static,
<<R::Output as Responder>::Body as MessageBody>::Error: Into<Box<dyn StdError + 'static>>,
{ {
Route::new().to(handler) Route::new().to(handler)
} }