Switch to pin-project-lite

This commit is contained in:
Steven Fackler 2019-11-18 18:12:34 -08:00
parent 6e2435eb60
commit c98f605622
3 changed files with 19 additions and 17 deletions

View File

@ -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" }

View File

@ -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 {
pin_project! {
/// A stream of table rows.
pub struct RowStream {
statement: Statement,
responses: Responses,
#[pin]
_p: PhantomPinned,
}
}
impl Stream for RowStream {

View File

@ -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<Bytes, Error> {
})
}
/// A stream of simple query results.
#[pin_project]
pub struct SimpleQueryStream {
pin_project! {
/// A stream of simple query results.
pub struct SimpleQueryStream {
responses: Responses,
columns: Option<Arc<[String]>>,
#[pin]
_p: PhantomPinned,
}
}
impl Stream for SimpleQueryStream {