From cf381ce6a2e44ca5ff13b1b2c34541d1e9af7199 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Fri, 15 Apr 2022 23:57:30 +0300 Subject: [PATCH] Hide `tokio_postgres::client::SocketConfig` behind "runtime" feature This fixes warnings reported by rust 1.60 when doing the following: ```shell $ cargo test --manifest-path tokio-postgres/Cargo.toml --no-default-features ``` --- tokio-postgres/src/client.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tokio-postgres/src/client.rs b/tokio-postgres/src/client.rs index dea77da94..42d507fda 100644 --- a/tokio-postgres/src/client.rs +++ b/tokio-postgres/src/client.rs @@ -1,5 +1,7 @@ use crate::codec::{BackendMessages, FrontendMessage}; -use crate::config::{Host, SslMode}; +#[cfg(feature = "runtime")] +use crate::config::Host; +use crate::config::SslMode; use crate::connection::{Request, RequestMessages}; use crate::copy_out::CopyOutStream; use crate::query::RowStream; @@ -25,6 +27,7 @@ use std::collections::HashMap; use std::fmt; use std::sync::Arc; use std::task::{Context, Poll}; +#[cfg(feature = "runtime")] use std::time::Duration; use tokio::io::{AsyncRead, AsyncWrite}; @@ -145,6 +148,7 @@ impl InnerClient { } } +#[cfg(feature = "runtime")] #[derive(Clone)] pub(crate) struct SocketConfig { pub host: Host,