From c98f605622634dc2fc78c0ae750be158eab08eef Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 18 Nov 2019 18:12:34 -0800 Subject: [PATCH] Switch to pin-project-lite --- tokio-postgres/Cargo.toml | 2 +- tokio-postgres/src/query.rs | 17 +++++++++-------- tokio-postgres/src/simple_query.rs | 17 +++++++++-------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tokio-postgres/Cargo.toml b/tokio-postgres/Cargo.toml index f255cab4..73e05ca3 100644 --- a/tokio-postgres/Cargo.toml +++ b/tokio-postgres/Cargo.toml @@ -42,7 +42,7 @@ futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] } log = "0.4" parking_lot = "0.9" percent-encoding = "2.0" -pin-project = "0.4" +pin-project-lite = "0.1" phf = "0.8" postgres-protocol = { version = "=0.5.0-alpha.1", path = "../postgres-protocol" } postgres-types = { version = "=0.1.0-alpha.1", path = "../postgres-types" } diff --git a/tokio-postgres/src/query.rs b/tokio-postgres/src/query.rs index 5a1b7b49..02415449 100644 --- a/tokio-postgres/src/query.rs +++ b/tokio-postgres/src/query.rs @@ -5,7 +5,7 @@ use crate::types::{IsNull, ToSql}; use crate::{Error, Portal, Row, Statement}; use bytes::{Bytes, BytesMut}; use futures::{ready, Stream}; -use pin_project::pin_project; +use pin_project_lite::pin_project; use postgres_protocol::message::backend::Message; use postgres_protocol::message::frontend; use std::marker::PhantomPinned; @@ -149,13 +149,14 @@ where } } -/// A stream of table rows. -#[pin_project] -pub struct RowStream { - statement: Statement, - responses: Responses, - #[pin] - _p: PhantomPinned, +pin_project! { + /// A stream of table rows. + pub struct RowStream { + statement: Statement, + responses: Responses, + #[pin] + _p: PhantomPinned, + } } impl Stream for RowStream { diff --git a/tokio-postgres/src/simple_query.rs b/tokio-postgres/src/simple_query.rs index 01858374..c78000ff 100644 --- a/tokio-postgres/src/simple_query.rs +++ b/tokio-postgres/src/simple_query.rs @@ -5,7 +5,7 @@ use crate::{Error, SimpleQueryMessage, SimpleQueryRow}; use bytes::Bytes; use fallible_iterator::FallibleIterator; use futures::{ready, Stream}; -use pin_project::pin_project; +use pin_project_lite::pin_project; use postgres_protocol::message::backend::Message; use postgres_protocol::message::frontend; use std::marker::PhantomPinned; @@ -47,13 +47,14 @@ fn encode(client: &InnerClient, query: &str) -> Result { }) } -/// A stream of simple query results. -#[pin_project] -pub struct SimpleQueryStream { - responses: Responses, - columns: Option>, - #[pin] - _p: PhantomPinned, +pin_project! { + /// A stream of simple query results. + pub struct SimpleQueryStream { + responses: Responses, + columns: Option>, + #[pin] + _p: PhantomPinned, + } } impl Stream for SimpleQueryStream {