Skip to content

Commit

Permalink
Add Deref impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lok52 committed Oct 13, 2023
1 parent e58fe56 commit 35fbeef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/blockscout-service-launcher/src/test_database.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::database::{
ConnectionTrait, Database, DatabaseConnection, DbErr, MigratorTrait, Statement,
};
use std::sync::Arc;
use std::{ops::Deref, sync::Arc};

#[derive(Clone, Debug)]
pub struct TestDbGuard {
Expand Down Expand Up @@ -82,3 +82,10 @@ impl TestDbGuard {
Migrator::up(db, None).await
}
}

impl Deref for TestDbGuard {
type Target = DatabaseConnection;
fn deref(&self) -> &Self::Target {
&*self.conn_with_db
}
}

0 comments on commit 35fbeef

Please sign in to comment.