Skip to content

Commit bfdc519

Browse files
committed
remove unnecessary pin project
1 parent 589abaf commit bfdc519

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ serde = "1.0.102"
3939
serde_json = "1.0.41"
4040
serde_qs = "0.5.0"
4141
async-std = { version = "1.0.1", features = ["unstable"] }
42-
pin-project-lite = "0.1.0"
4342
mime = "0.3.14"
4443
cookie = { version="0.12.0", features = ["percent-encode"]}
4544

src/request.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@ use std::{str::FromStr, sync::Arc};
1313
use crate::error::Error;
1414
use crate::middleware::cookies::CookieData;
1515

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>,
3128
}
3229

3330
impl<State> Request<State> {
@@ -311,11 +308,11 @@ impl<State> Request<State> {
311308

312309
impl<State> Read for Request<State> {
313310
fn poll_read(
314-
self: Pin<&mut Self>,
311+
mut self: Pin<&mut Self>,
315312
cx: &mut Context<'_>,
316313
buf: &mut [u8],
317314
) -> Poll<io::Result<usize>> {
318-
let mut this = self.project();
315+
let this = &mut *self;
319316
Pin::new(this.request.body_mut()).poll_read(cx, buf)
320317
}
321318
}

0 commit comments

Comments
 (0)