Skip to content

Commit

Permalink
Revert "Review fix: get_connect_timeout returns copied Option."
Browse files Browse the repository at this point in the history
This reverts commit 4882ecc.
  • Loading branch information
Hirotaka Azuma committed Aug 27, 2022
1 parent 4882ecc commit 5551b3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion postgres/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<&Duration> {
self.config.get_connect_timeout()
}

Expand Down
4 changes: 2 additions & 2 deletions tokio-postgres/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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().copied()
pub fn get_connect_timeout(&self) -> Option<&Duration> {
self.connect_timeout.as_ref()
}

/// Controls the use of TCP keepalive.
Expand Down

0 comments on commit 5551b3e

Please sign in to comment.