Skip to content

Commit

Permalink
bb8: replace trivial new() with derived Default impl
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Aug 28, 2024
1 parent d9518a8 commit 408fe7b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions bb8/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,11 @@ fn test_is_send_sync() {
}

// A connection manager that always returns `true` for `has_broken()`
#[derive(Default)]
struct BrokenConnectionManager<C> {
_c: PhantomData<C>,
}

impl<C> BrokenConnectionManager<C> {
fn new() -> Self {
BrokenConnectionManager { _c: PhantomData }
}
}

#[async_trait]
impl<C: Default + Send + Sync + 'static> ManageConnection for BrokenConnectionManager<C> {
type Connection = C;
Expand Down Expand Up @@ -250,7 +245,7 @@ async fn test_drop_on_broken() {
}

let pool = Pool::builder()
.build(BrokenConnectionManager::<Connection>::new())
.build(BrokenConnectionManager::<Connection>::default())
.await
.unwrap();

Expand Down

0 comments on commit 408fe7b

Please sign in to comment.