Review fix: get_connect_timeout returns copied Option.

This commit is contained in:
Hirotaka Azuma 2022-08-27 13:58:31 +00:00
parent 0fcd0c26a5
commit 4882ecc2de
2 changed files with 3 additions and 3 deletions

View File

@ -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()
}

View File

@ -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<Duration> {
self.connect_timeout.as_ref().copied()
}
/// Controls the use of TCP keepalive.