@@ -35,7 +35,7 @@ pub async fn accept<RW, F, Fut>(io: RW, endpoint: F) -> http_types::Result<()>
35
35
where
36
36
RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
37
37
F : Fn ( Request ) -> Fut ,
38
- Fut : Future < Output = http_types :: Result < Response > > ,
38
+ Fut : Future < Output = Response > ,
39
39
{
40
40
Server :: new ( io, endpoint) . accept ( ) . await
41
41
}
@@ -51,7 +51,7 @@ pub async fn accept_with_opts<RW, F, Fut>(
51
51
where
52
52
RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
53
53
F : Fn ( Request ) -> Fut ,
54
- Fut : Future < Output = http_types :: Result < Response > > ,
54
+ Fut : Future < Output = Response > ,
55
55
{
56
56
Server :: new ( io, endpoint) . with_opts ( opts) . accept ( ) . await
57
57
}
@@ -79,7 +79,7 @@ impl<RW, F, Fut> Server<RW, F, Fut>
79
79
where
80
80
RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
81
81
F : Fn ( Request ) -> Fut ,
82
- Fut : Future < Output = http_types :: Result < Response > > ,
82
+ Fut : Future < Output = Response > ,
83
83
{
84
84
/// builds a new server
85
85
pub fn new ( io : RW , endpoint : F ) -> Self {
@@ -108,7 +108,7 @@ where
108
108
where
109
109
RW : Read + Write + Clone + Send + Sync + Unpin + ' static ,
110
110
F : Fn ( Request ) -> Fut ,
111
- Fut : Future < Output = http_types :: Result < Response > > ,
111
+ Fut : Future < Output = Response > ,
112
112
{
113
113
// Decode a new request, timing out if this takes longer than the timeout duration.
114
114
let fut = decode ( self . io . clone ( ) ) ;
@@ -142,7 +142,7 @@ where
142
142
let method = req. method ( ) ;
143
143
144
144
// Pass the request to the endpoint and encode the response.
145
- let mut res = ( self . endpoint ) ( req) . await ? ;
145
+ let mut res = ( self . endpoint ) ( req) . await ;
146
146
147
147
close_connection |= res
148
148
. header ( CONNECTION )
0 commit comments