diff --git a/postgres/src/config.rs b/postgres/src/config.rs index b541ec84..db8d6613 100644 --- a/postgres/src/config.rs +++ b/postgres/src/config.rs @@ -252,7 +252,7 @@ impl Config { /// Gets the connection timeout, if one has been set with the /// `connect_timeout` method. - pub fn get_connect_timeout(&self) -> Option<&Duration> { + pub fn get_connect_timeout(&self) -> Option { self.config.get_connect_timeout() } diff --git a/tokio-postgres/src/config.rs b/tokio-postgres/src/config.rs index e8d05764..3a11e99c 100644 --- a/tokio-postgres/src/config.rs +++ b/tokio-postgres/src/config.rs @@ -336,8 +336,8 @@ impl Config { /// Gets the connection timeout, if one has been set with the /// `connect_timeout` method. - pub fn get_connect_timeout(&self) -> Option<&Duration> { - self.connect_timeout.as_ref() + pub fn get_connect_timeout(&self) -> Option { + self.connect_timeout.as_ref().copied() } /// Controls the use of TCP keepalive.