@@ -35,7 +35,7 @@ pub async fn accept<RW, F, Fut>(io: RW, endpoint: F) -> http_types::Result<()>
3535where
3636 RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
3737 F : Fn ( Request ) -> Fut ,
38- Fut : Future < Output = http_types :: Result < Response > > ,
38+ Fut : Future < Output = Response > ,
3939{
4040 Server :: new ( io, endpoint) . accept ( ) . await
4141}
@@ -51,7 +51,7 @@ pub async fn accept_with_opts<RW, F, Fut>(
5151where
5252 RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
5353 F : Fn ( Request ) -> Fut ,
54- Fut : Future < Output = http_types :: Result < Response > > ,
54+ Fut : Future < Output = Response > ,
5555{
5656 Server :: new ( io, endpoint) . with_opts ( opts) . accept ( ) . await
5757}
@@ -79,7 +79,7 @@ impl<RW, F, Fut> Server<RW, F, Fut>
7979where
8080 RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
8181 F : Fn ( Request ) -> Fut ,
82- Fut : Future < Output = http_types :: Result < Response > > ,
82+ Fut : Future < Output = Response > ,
8383{
8484 /// builds a new server
8585 pub fn new ( io : RW , endpoint : F ) -> Self {
@@ -108,7 +108,7 @@ where
108108 where
109109 RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
110110 F : Fn ( Request ) -> Fut ,
111- Fut : Future < Output = http_types :: Result < Response > > ,
111+ Fut : Future < Output = Response > ,
112112 {
113113 // Decode a new request, timing out if this takes longer than the timeout duration.
114114 let fut = decode ( self . io . clone ( ) ) ;
@@ -140,7 +140,7 @@ where
140140 let method = req. method ( ) ;
141141
142142 // Pass the request to the endpoint and encode the response.
143- let mut res = ( self . endpoint ) ( req) . await ? ;
143+ let mut res = ( self . endpoint ) ( req) . await ;
144144
145145 close_connection |= res
146146 . header ( CONNECTION )
0 commit comments