Skip to content

Commit

Permalink
Changed to 'impl Into<Option<T>>'
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Jan 20, 2024
1 parent 40fe320 commit 9997546
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions bb8/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,7 @@ impl<M: ManageConnection> Builder<M> {
///
/// Defaults to None.
#[must_use]
pub fn min_idle<U>(mut self, min_idle: U) -> Self
where
U: Into<Option<u32>>,
{
pub fn min_idle(mut self, min_idle: impl Into<Option<u32>>) -> Self {
self.min_idle = min_idle.into();
self
}
Expand Down Expand Up @@ -197,10 +194,7 @@ impl<M: ManageConnection> Builder<M> {
///
/// Will panic if `max_lifetime` is 0.
#[must_use]
pub fn max_lifetime<D>(mut self, max_lifetime: D) -> Self
where
D: Into<Option<Duration>>,
{
pub fn max_lifetime(mut self, max_lifetime: impl Into<Option<Duration>>) -> Self {
let max_lifetime = max_lifetime.into();
assert_ne!(
max_lifetime,
Expand All @@ -222,10 +216,7 @@ impl<M: ManageConnection> Builder<M> {
///
/// Will panic if `idle_timeout` is 0.
#[must_use]
pub fn idle_timeout<D>(mut self, idle_timeout: D) -> Self
where
D: Into<Option<Duration>>,
{
pub fn idle_timeout(mut self, idle_timeout: impl Into<Option<Duration>>) -> Self {
let idle_timeout = idle_timeout.into();

Check warning on line 220 in bb8/src/api.rs

View check run for this annotation

Codecov / codecov/patch

bb8/src/api.rs#L219-L220

Added lines #L219 - L220 were not covered by tests
assert_ne!(
idle_timeout,
Expand Down

0 comments on commit 9997546

Please sign in to comment.