refactor(lib): Switch from pin-project to pin-project-lite (#2566)
Note the practical affects of this change: - Dependency count with --features full dropped from 65 to 55. - Time to compile after a clean dropped from 48s to 35s (on a pretty underpowered VM). Closes #2388
This commit is contained in:
@@ -11,7 +11,7 @@ use std::time::Duration;
|
||||
|
||||
use futures_util::future::Either;
|
||||
use http::uri::{Scheme, Uri};
|
||||
use pin_project::pin_project;
|
||||
use pin_project_lite::pin_project;
|
||||
use tokio::net::{TcpSocket, TcpStream};
|
||||
use tokio::time::Sleep;
|
||||
|
||||
@@ -373,18 +373,19 @@ impl HttpInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// Not publicly exported (so missing_docs doesn't trigger).
|
||||
//
|
||||
// We return this `Future` instead of the `Pin<Box<dyn Future>>` directly
|
||||
// so that users don't rely on it fitting in a `Pin<Box<dyn Future>>` slot
|
||||
// (and thus we can change the type in the future).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[pin_project]
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct HttpConnecting<R> {
|
||||
#[pin]
|
||||
fut: BoxConnecting,
|
||||
_marker: PhantomData<R>,
|
||||
pin_project! {
|
||||
// Not publicly exported (so missing_docs doesn't trigger).
|
||||
//
|
||||
// We return this `Future` instead of the `Pin<Box<dyn Future>>` directly
|
||||
// so that users don't rely on it fitting in a `Pin<Box<dyn Future>>` slot
|
||||
// (and thus we can change the type in the future).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[allow(missing_debug_implementations)]
|
||||
pub struct HttpConnecting<R> {
|
||||
#[pin]
|
||||
fut: BoxConnecting,
|
||||
_marker: PhantomData<R>,
|
||||
}
|
||||
}
|
||||
|
||||
type ConnectResult = Result<TcpStream, ConnectError>;
|
||||
|
||||
Reference in New Issue
Block a user