@@ -13,21 +13,18 @@ use std::{str::FromStr, sync::Arc};
13
13
use crate :: error:: Error ;
14
14
use crate :: middleware:: cookies:: CookieData ;
15
15
16
- pin_project_lite:: pin_project! {
17
- /// An HTTP request.
18
- ///
19
- /// The `Request` gives endpoints access to basic information about the incoming
20
- /// request, route parameters, and various ways of accessing the request's body.
21
- ///
22
- /// Requests also provide *extensions*, a type map primarily used for low-level
23
- /// communication between middleware and endpoints.
24
- #[ derive( Debug ) ]
25
- pub struct Request <State > {
26
- pub ( crate ) state: Arc <State >,
27
- #[ pin]
28
- pub ( crate ) request: http_service:: Request ,
29
- pub ( crate ) route_params: Vec <Params >,
30
- }
16
+ /// An HTTP request.
17
+ ///
18
+ /// The `Request` gives endpoints access to basic information about the incoming
19
+ /// request, route parameters, and various ways of accessing the request's body.
20
+ ///
21
+ /// Requests also provide *extensions*, a type map primarily used for low-level
22
+ /// communication between middleware and endpoints.
23
+ #[ derive( Debug ) ]
24
+ pub struct Request < State > {
25
+ pub ( crate ) state : Arc < State > ,
26
+ pub ( crate ) request : http_service:: Request ,
27
+ pub ( crate ) route_params : Vec < Params > ,
31
28
}
32
29
33
30
impl < State > Request < State > {
@@ -311,11 +308,11 @@ impl<State> Request<State> {
311
308
312
309
impl < State > Read for Request < State > {
313
310
fn poll_read (
314
- self : Pin < & mut Self > ,
311
+ mut self : Pin < & mut Self > ,
315
312
cx : & mut Context < ' _ > ,
316
313
buf : & mut [ u8 ] ,
317
314
) -> Poll < io:: Result < usize > > {
318
- let mut this = self . project ( ) ;
315
+ let this = & mut * self ;
319
316
Pin :: new ( this. request . body_mut ( ) ) . poll_read ( cx, buf)
320
317
}
321
318
}
0 commit comments