mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-28 07:30:36 +02:00
remove pin-project; update Unpin consrtaint
This commit is contained in:
@ -40,7 +40,6 @@ actix-rt = "1.0.0-alpha.1"
|
||||
derive_more = "0.15"
|
||||
either = "1.5.2"
|
||||
futures = "0.3.1"
|
||||
pin-project = "0.4.5"
|
||||
http = { version = "0.1.17", optional = true }
|
||||
log = "0.4"
|
||||
tokio-net = "=0.2.0-alpha.6"
|
||||
|
@ -8,7 +8,6 @@ use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{err, ok, BoxFuture, Either, FutureExt, Ready};
|
||||
use pin_project::pin_project;
|
||||
use tokio_net::tcp::TcpStream;
|
||||
|
||||
use super::connect::{Address, Connect, Connection};
|
||||
@ -94,7 +93,6 @@ impl<T: Address> Service for TcpConnector<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[pin_project]
|
||||
#[doc(hidden)]
|
||||
/// Tcp stream connector response future
|
||||
pub struct TcpConnectorResponse<T> {
|
||||
@ -137,7 +135,7 @@ impl<T: Address> Future for TcpConnectorResponse<T> {
|
||||
type Output = Result<Connection<T, TcpStream>, ConnectError>;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
|
||||
let this = self.project();
|
||||
let this = self.get_mut();
|
||||
|
||||
// connect
|
||||
loop {
|
||||
@ -167,7 +165,7 @@ impl<T: Address> Future for TcpConnectorResponse<T> {
|
||||
|
||||
// try to connect
|
||||
let addr = this.addrs.as_mut().unwrap().pop_front().unwrap();
|
||||
*this.stream = Some(TcpStream::connect(addr).boxed());
|
||||
this.stream = Some(TcpStream::connect(addr).boxed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ use std::task::{Context, Poll};
|
||||
|
||||
use actix_service::{Service, ServiceFactory};
|
||||
use futures::future::{ok, Either, Ready};
|
||||
use pin_project::pin_project;
|
||||
use trust_dns_resolver::lookup_ip::LookupIpFuture;
|
||||
use trust_dns_resolver::{AsyncResolver, Background};
|
||||
|
||||
@ -129,12 +128,10 @@ impl<T: Address> Service for Resolver<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[pin_project]
|
||||
#[doc(hidden)]
|
||||
/// Resolver future
|
||||
pub struct ResolverFuture<T: Address> {
|
||||
req: Option<Connect<T>>,
|
||||
#[pin]
|
||||
lookup: Background<LookupIpFuture>,
|
||||
}
|
||||
|
||||
@ -157,9 +154,9 @@ impl<T: Address> Future for ResolverFuture<T> {
|
||||
type Output = Result<Connect<T>, ConnectError>;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
|
||||
let this = self.project();
|
||||
let this = self.get_mut();
|
||||
|
||||
match this.lookup.poll(cx) {
|
||||
match Pin::new(&mut this.lookup).poll(cx) {
|
||||
Poll::Pending => Poll::Pending,
|
||||
Poll::Ready(Ok(ips)) => {
|
||||
let req = this.req.take().unwrap();
|
||||
|
Reference in New Issue
Block a user