Revert "refactor(lib): Switch from pin-project to pin-project-lite"

This reverts commit 43412a950f.
This commit is contained in:
Sean McArthur
2021-02-05 15:37:21 -08:00
parent 48d4594930
commit 7390f026d7
14 changed files with 262 additions and 343 deletions

View File

@@ -9,7 +9,7 @@
#[cfg(feature = "stream")]
use futures_core::Stream;
#[cfg(feature = "stream")]
use pin_project_lite::pin_project;
use pin_project::pin_project;
use crate::common::{
task::{self, Poll},
@@ -86,12 +86,8 @@ pub fn from_stream<S, IO, E>(stream: S) -> impl Accept<Conn = IO, Error = E>
where
S: Stream<Item = Result<IO, E>>,
{
pin_project! {
struct FromStream<S> {
#[pin]
stream: S,
}
}
#[pin_project]
struct FromStream<S>(#[pin] S);
impl<S, IO, E> Accept for FromStream<S>
where
@@ -103,9 +99,9 @@ where
self: Pin<&mut Self>,
cx: &mut task::Context<'_>,
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
self.project().stream.poll_next(cx)
self.project().0.poll_next(cx)
}
}
FromStream { stream }
FromStream(stream)
}