1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-18 07:35:36 +00:00

Use #[pin_project] with ConnectorPoolSupport

This removes a use of `Pin::get_unchecked_mut`
This commit is contained in:
Aaron Hill 2020-02-19 21:03:53 -05:00
parent 809930d36e
commit e6811e8818
No known key found for this signature in database
GPG key ID: B4087E510E98B164

View file

@ -17,6 +17,7 @@ use h2::client::{handshake, Connection, SendRequest};
use http::uri::Authority;
use indexmap::IndexSet;
use slab::Slab;
use pin_project::pin_project;
use super::connection::{ConnectionType, IoConnection};
use super::error::ConnectError;
@ -422,6 +423,7 @@ where
}
}
#[pin_project]
struct ConnectorPoolSupport<T, Io>
where
Io: AsyncRead + AsyncWrite + Unpin + 'static,
@ -439,7 +441,7 @@ where
type Output = ();
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = unsafe { self.get_unchecked_mut() };
let this = self.project();
let mut inner = this.inner.as_ref().borrow_mut();
inner.waker.register(cx.waker());