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