From 6ab7cfa2bef32eef7dca2c75223dc4199aca0aec Mon Sep 17 00:00:00 2001 From: Masayuki Nagamachi Date: Sun, 16 Feb 2020 04:18:31 +0900 Subject: [PATCH 1/3] Remove descriptions about undefined `uds` feature from docs (#1356) --- src/server.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/server.rs b/src/server.rs index 11cfbb6bc..97dd9f7f7 100644 --- a/src/server.rs +++ b/src/server.rs @@ -443,8 +443,6 @@ where #[cfg(unix)] /// Start listening for unix domain connections on existing listener. - /// - /// This method is available with `uds` feature. pub fn listen_uds( mut self, lst: std::os::unix::net::UnixListener, @@ -483,8 +481,6 @@ where #[cfg(unix)] /// Start listening for incoming unix domain connections. - /// - /// This method is available with `uds` feature. pub fn bind_uds(mut self, addr: A) -> io::Result where A: AsRef, From 809930d36e3d414662205ad02eb514083843463b Mon Sep 17 00:00:00 2001 From: Elliot Jackson Date: Wed, 19 Feb 2020 21:13:10 +0100 Subject: [PATCH 2/3] Add dependencies to docs example (#1343) * Add dependencies to docs example * Change codeblock type to toml * Clarify the need for actix-rt Co-authored-by: Yuki Okushi --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d51005cfe..a898bd704 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,12 @@ //! Actix web is a small, pragmatic, and extremely fast web framework //! for Rust. //! +//! ## Example +//! +//! The `#[actix_rt::main]` macro in the example below is provided by the Actix runtime +//! crate, [`actix-rt`](https://crates.io/crates/actix-rt). You will need to include +//! `actix-rt` in your dependencies for it to run. +//! //! ```rust,no_run //! use actix_web::{web, App, Responder, HttpServer}; //! From e6811e8818b015c31f88d22bd037d3377deac1c3 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Wed, 19 Feb 2020 21:03:53 -0500 Subject: [PATCH 3/3] Use #[pin_project] with `ConnectorPoolSupport` This removes a use of `Pin::get_unchecked_mut` --- actix-http/src/client/pool.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actix-http/src/client/pool.rs b/actix-http/src/client/pool.rs index 8c94423ac..139cf9f66 100644 --- a/actix-http/src/client/pool.rs +++ b/actix-http/src/client/pool.rs @@ -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 where Io: AsyncRead + AsyncWrite + Unpin + 'static, @@ -439,7 +441,7 @@ where type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - 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());