Skip to content

Commit 8f955eb

Browse files
authored
Merge pull request #935 from Some-Dood/deps/prefer-sub-crates
Deps: prefer sub-crates of `futures`
2 parents a624282 + 44eac98 commit 8f955eb

31 files changed

+57
-55
lines changed

postgres-native-tls/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ default = ["runtime"]
1616
runtime = ["tokio-postgres/runtime"]
1717

1818
[dependencies]
19-
futures = "0.3"
2019
native-tls = "0.2"
2120
tokio = "1.0"
2221
tokio-native-tls = "0.3"
2322
tokio-postgres = { version = "0.7.0", path = "../tokio-postgres", default-features = false }
2423

2524
[dev-dependencies]
26-
tokio = { version = "1.0", features = ["full"] }
25+
futures-util = "0.3"
26+
tokio = { version = "1.0", features = ["macros", "net", "rt"] }
2727
postgres = { version = "0.19.0", path = "../postgres" }

postgres-native-tls/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use futures::FutureExt;
1+
use futures_util::FutureExt;
22
use native_tls::{self, Certificate};
33
use tokio::net::TcpStream;
44
use tokio_postgres::tls::TlsConnect;

postgres-openssl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ default = ["runtime"]
1616
runtime = ["tokio-postgres/runtime"]
1717

1818
[dependencies]
19-
futures = "0.3"
2019
openssl = "0.10"
2120
tokio = "1.0"
2221
tokio-openssl = "0.6"
2322
tokio-postgres = { version = "0.7.0", path = "../tokio-postgres", default-features = false }
2423

2524
[dev-dependencies]
26-
tokio = { version = "1.0", features = ["full"] }
25+
futures-util = "0.3"
26+
tokio = { version = "1.0", features = ["macros", "net", "rt"] }
2727
postgres = { version = "0.19.0", path = "../postgres" }

postgres-openssl/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,17 @@ use tokio_postgres::tls::{ChannelBinding, TlsConnect};
7373
#[cfg(test)]
7474
mod test;
7575

76+
type ConfigCallback =
77+
dyn Fn(&mut ConnectConfiguration, &str) -> Result<(), ErrorStack> + Sync + Send;
78+
7679
/// A `MakeTlsConnect` implementation using the `openssl` crate.
7780
///
7881
/// Requires the `runtime` Cargo feature (enabled by default).
7982
#[cfg(feature = "runtime")]
8083
#[derive(Clone)]
8184
pub struct MakeTlsConnector {
8285
connector: SslConnector,
83-
config: Arc<dyn Fn(&mut ConnectConfiguration, &str) -> Result<(), ErrorStack> + Sync + Send>,
86+
config: Arc<ConfigCallback>,
8487
}
8588

8689
#[cfg(feature = "runtime")]

postgres-openssl/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use futures::FutureExt;
1+
use futures_util::FutureExt;
22
use openssl::ssl::{SslConnector, SslMethod};
33
use tokio::net::TcpStream;
44
use tokio_postgres::tls::TlsConnect;

postgres-types/src/special.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::{i32, i64};
66
use crate::{FromSql, IsNull, ToSql, Type};
77

88
/// A wrapper that can be used to represent infinity with `Type::Date` types.
9-
#[derive(Debug, Clone, Copy, PartialEq)]
9+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1010
pub enum Date<T> {
1111
/// Represents `infinity`, a date that is later than all other dates.
1212
PosInfinity,
@@ -55,7 +55,7 @@ impl<T: ToSql> ToSql for Date<T> {
5555

5656
/// A wrapper that can be used to represent infinity with `Type::Timestamp` and `Type::Timestamptz`
5757
/// types.
58-
#[derive(Debug, Clone, Copy, PartialEq)]
58+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5959
pub enum Timestamp<T> {
6060
/// Represents `infinity`, a timestamp that is later than all other timestamps.
6161
PosInfinity,

postgres/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ with-time-0_3 = ["tokio-postgres/with-time-0_3"]
3737
[dependencies]
3838
bytes = "1.0"
3939
fallible-iterator = "0.2"
40-
futures = "0.3"
40+
futures-util = { version = "0.3", features = ["sink"] }
4141
tokio-postgres = { version = "0.7.6", path = "../tokio-postgres" }
4242

4343
tokio = { version = "1.0", features = ["rt", "time"] }
4444
log = "0.4"
4545

4646
[dev-dependencies]
4747
criterion = "0.3"
48+
tokio = { version = "1.0", features = ["rt-multi-thread"] }

postgres/src/binary_copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::connection::ConnectionRef;
44
use crate::types::{BorrowToSql, ToSql, Type};
55
use crate::{CopyInWriter, CopyOutReader, Error};
66
use fallible_iterator::FallibleIterator;
7-
use futures::StreamExt;
7+
use futures_util::StreamExt;
88
use std::pin::Pin;
99
#[doc(inline)]
1010
pub use tokio_postgres::binary_copy::BinaryCopyOutRow;

postgres/src/connection.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::{Error, Notification};
2-
use futures::future;
3-
use futures::{pin_mut, Stream};
2+
use futures_util::{future, pin_mut, Stream};
43
use std::collections::VecDeque;
54
use std::future::Future;
65
use std::ops::{Deref, DerefMut};

postgres/src/copy_in_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::connection::ConnectionRef;
22
use crate::lazy_pin::LazyPin;
33
use bytes::{Bytes, BytesMut};
4-
use futures::SinkExt;
4+
use futures_util::SinkExt;
55
use std::io;
66
use std::io::Write;
77
use tokio_postgres::{CopyInSink, Error};

0 commit comments

Comments
 (0)