diff --git a/bb8/src/api.rs b/bb8/src/api.rs index 4db833c..548fd04 100644 --- a/bb8/src/api.rs +++ b/bb8/src/api.rs @@ -165,8 +165,8 @@ impl Builder { /// /// Defaults to None. #[must_use] - pub fn min_idle(mut self, min_idle: Option) -> Self { - self.min_idle = min_idle; + pub fn min_idle(mut self, min_idle: impl Into>) -> Self { + self.min_idle = min_idle.into(); self } @@ -194,7 +194,8 @@ impl Builder { /// /// Will panic if `max_lifetime` is 0. #[must_use] - pub fn max_lifetime(mut self, max_lifetime: Option) -> Self { + pub fn max_lifetime(mut self, max_lifetime: impl Into>) -> Self { + let max_lifetime = max_lifetime.into(); assert_ne!( max_lifetime, Some(Duration::from_secs(0)), @@ -215,7 +216,8 @@ impl Builder { /// /// Will panic if `idle_timeout` is 0. #[must_use] - pub fn idle_timeout(mut self, idle_timeout: Option) -> Self { + pub fn idle_timeout(mut self, idle_timeout: impl Into>) -> Self { + let idle_timeout = idle_timeout.into(); assert_ne!( idle_timeout, Some(Duration::from_secs(0)),