Skip to content

Commit cc02b3b

Browse files
committed
clean up
1 parent 04892ce commit cc02b3b

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

sentry/src/db.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ pub mod tests_postgres {
185185
pub fn new(name: String, pool: DbPool) -> Self {
186186
Self { name, pool }
187187
}
188-
189-
pub fn get_pool(&self) -> deadpool_postgres::Pool<NoTls> {
190-
self.pool.clone()
191-
}
192188
}
193189

194190
impl Deref for Database {

sentry/src/db/campaign.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ mod test {
6161
async fn it_inserts_and_fetches_campaign() {
6262
let database = DATABASE_POOL.get().await.expect("Should get a DB pool");
6363

64-
setup_test_migrations(database.get_pool())
64+
setup_test_migrations(database.pool.clone())
6565
.await
6666
.expect("Migrations should succeed");
6767

6868
let campaign_for_testing = DUMMY_CAMPAIGN.clone();
69-
let is_inserted = insert_campaign(&database.get_pool(), &campaign_for_testing)
69+
let is_inserted = insert_campaign(&database.pool, &campaign_for_testing)
7070
.await
7171
.expect("Should succeed");
7272

7373
assert!(is_inserted);
7474

75-
let fetched_campaign = fetch_campaign(database.get_pool(), &campaign_for_testing)
75+
let fetched_campaign = fetch_campaign(database.pool.clone(), &campaign_for_testing)
7676
.await
7777
.expect("Should fetch successfully");
7878

sentry/src/db/spendable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mod test {
6262
async fn it_inserts_and_fetches_spendable() {
6363
let database = DATABASE_POOL.get().await.expect("Should get a DB pool");
6464

65-
setup_test_migrations(database.get_pool())
65+
setup_test_migrations(database.pool.clone())
6666
.await
6767
.expect("Migrations should succeed");
6868

@@ -74,14 +74,14 @@ mod test {
7474
still_on_create2: UnifiedNum::from(500_000),
7575
},
7676
};
77-
let is_inserted = insert_spendable(database.get_pool(), &spendable)
77+
let is_inserted = insert_spendable(database.pool.clone(), &spendable)
7878
.await
7979
.expect("Should succeed");
8080

8181
assert!(is_inserted);
8282

8383
let fetched_spendable = fetch_spendable(
84-
database.get_pool(),
84+
database.pool.clone(),
8585
&spendable.spender,
8686
&spendable.channel.id(),
8787
)

0 commit comments

Comments
 (0)