X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_schema%2Fsrc%2Faggregates%2Fsite_aggregates.rs;h=ea3da85aeaf9e12c2601a834d79d0edc5a388634;hb=92568956353f21649ed9aff68b42699c9d036f30;hp=cfc14df431e23185ea28c240a647f56ce7a6e7d1;hpb=9c2490d4f24671cc2770ba68feaf6d7562b1db6a;p=lemmy.git diff --git a/crates/db_schema/src/aggregates/site_aggregates.rs b/crates/db_schema/src/aggregates/site_aggregates.rs index cfc14df4..ea3da85a 100644 --- a/crates/db_schema/src/aggregates/site_aggregates.rs +++ b/crates/db_schema/src/aggregates/site_aggregates.rs @@ -7,7 +7,7 @@ use diesel::result::Error; use diesel_async::RunQueryDsl; impl SiteAggregates { - pub async fn read(pool: &DbPool) -> Result { + pub async fn read(pool: &mut DbPool<'_>) -> Result { let conn = &mut get_conn(pool).await?; site_aggregates::table.first::(conn).await } @@ -15,6 +15,9 @@ impl SiteAggregates { #[cfg(test)] mod tests { + #![allow(clippy::unwrap_used)] + #![allow(clippy::indexing_slicing)] + use crate::{ aggregates::site_aggregates::SiteAggregates, source::{ @@ -30,7 +33,9 @@ mod tests { }; use serial_test::serial; - async fn prepare_site_with_community(pool: &DbPool) -> (Instance, Person, Site, Community) { + async fn prepare_site_with_community( + pool: &mut DbPool<'_>, + ) -> (Instance, Person, Site, Community) { let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string()) .await .unwrap(); @@ -70,6 +75,7 @@ mod tests { #[serial] async fn test_crud() { let pool = &build_db_pool_for_tests().await; + let pool = &mut pool.into(); let (inserted_instance, inserted_person, inserted_site, inserted_community) = prepare_site_with_community(pool).await; @@ -143,6 +149,7 @@ mod tests { #[serial] async fn test_soft_delete() { let pool = &build_db_pool_for_tests().await; + let pool = &mut pool.into(); let (inserted_instance, inserted_person, inserted_site, inserted_community) = prepare_site_with_community(pool).await;