From 4882ecc2de0b02183f4c69249d59178ec5e11f40 Mon Sep 17 00:00:00 2001 From: Hirotaka Azuma Date: Sat, 27 Aug 2022 13:58:31 +0000 Subject: [PATCH] Review fix: get_connect_timeout returns copied Option. --- postgres/src/config.rs | 2 +- tokio-postgres/src/config.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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.