Skip to content

Commit c98f605

Browse files
committed
Switch to pin-project-lite
1 parent 6e2435e commit c98f605

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

tokio-postgres/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
4242
log = "0.4"
4343
parking_lot = "0.9"
4444
percent-encoding = "2.0"
45-
pin-project = "0.4"
45+
pin-project-lite = "0.1"
4646
phf = "0.8"
4747
postgres-protocol = { version = "=0.5.0-alpha.1", path = "../postgres-protocol" }
4848
postgres-types = { version = "=0.1.0-alpha.1", path = "../postgres-types" }

tokio-postgres/src/query.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::types::{IsNull, ToSql};
55
use crate::{Error, Portal, Row, Statement};
66
use bytes::{Bytes, BytesMut};
77
use futures::{ready, Stream};
8-
use pin_project::pin_project;
8+
use pin_project_lite::pin_project;
99
use postgres_protocol::message::backend::Message;
1010
use postgres_protocol::message::frontend;
1111
use std::marker::PhantomPinned;
@@ -149,13 +149,14 @@ where
149149
}
150150
}
151151

152-
/// A stream of table rows.
153-
#[pin_project]
154-
pub struct RowStream {
155-
statement: Statement,
156-
responses: Responses,
157-
#[pin]
158-
_p: PhantomPinned,
152+
pin_project! {
153+
/// A stream of table rows.
154+
pub struct RowStream {
155+
statement: Statement,
156+
responses: Responses,
157+
#[pin]
158+
_p: PhantomPinned,
159+
}
159160
}
160161

161162
impl Stream for RowStream {

tokio-postgres/src/simple_query.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{Error, SimpleQueryMessage, SimpleQueryRow};
55
use bytes::Bytes;
66
use fallible_iterator::FallibleIterator;
77
use futures::{ready, Stream};
8-
use pin_project::pin_project;
8+
use pin_project_lite::pin_project;
99
use postgres_protocol::message::backend::Message;
1010
use postgres_protocol::message::frontend;
1111
use std::marker::PhantomPinned;
@@ -47,13 +47,14 @@ fn encode(client: &InnerClient, query: &str) -> Result<Bytes, Error> {
4747
})
4848
}
4949

50-
/// A stream of simple query results.
51-
#[pin_project]
52-
pub struct SimpleQueryStream {
53-
responses: Responses,
54-
columns: Option<Arc<[String]>>,
55-
#[pin]
56-
_p: PhantomPinned,
50+
pin_project! {
51+
/// A stream of simple query results.
52+
pub struct SimpleQueryStream {
53+
responses: Responses,
54+
columns: Option<Arc<[String]>>,
55+
#[pin]
56+
_p: PhantomPinned,
57+
}
5758
}
5859

5960
impl Stream for SimpleQueryStream {

0 commit comments

Comments
 (0)