Skip to content

Commit cc33f01

Browse files
authored
Merge pull request #410 from laizy/master
remove unnecessary pin project
2 parents af2409a + bfdc519 commit cc33f01

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
@@ -12,21 +12,18 @@ use std::{str::FromStr, sync::Arc};
1212

1313
use crate::middleware::cookies::CookieData;
1414

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

3229
impl<State> Request<State> {
@@ -310,11 +307,11 @@ impl<State> Request<State> {
310307

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

0 commit comments

Comments
 (0)