X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_schema%2Fsrc%2Faggregates%2Fcomment_aggregates.rs;h=12b57222805cc23e82484e98085016599d697d95;hb=1d38aad9d3d51ef606074d5b49a8030c49dd0e9e;hp=5a5550a2ec2920f83049946a7cd9e9ce2d0d18c1;hpb=73492af4b09448684ffde3d55454434ec3ed490b;p=lemmy.git diff --git a/crates/db_schema/src/aggregates/comment_aggregates.rs b/crates/db_schema/src/aggregates/comment_aggregates.rs index 5a5550a2..12b57222 100644 --- a/crates/db_schema/src/aggregates/comment_aggregates.rs +++ b/crates/db_schema/src/aggregates/comment_aggregates.rs @@ -8,7 +8,7 @@ use diesel::{result::Error, ExpressionMethods, QueryDsl}; use diesel_async::RunQueryDsl; impl CommentAggregates { - pub async fn read(pool: &DbPool, comment_id: CommentId) -> Result { + pub async fn read(pool: &mut DbPool<'_>, comment_id: CommentId) -> Result { let conn = &mut get_conn(pool).await?; comment_aggregates::table .filter(comment_aggregates::comment_id.eq(comment_id)) @@ -16,7 +16,10 @@ impl CommentAggregates { .await } - pub async fn update_hot_rank(pool: &DbPool, comment_id: CommentId) -> Result { + pub async fn update_hot_rank( + pool: &mut DbPool<'_>, + comment_id: CommentId, + ) -> Result { let conn = &mut get_conn(pool).await?; diesel::update(comment_aggregates::table) @@ -50,6 +53,7 @@ mod tests { #[serial] async fn test_crud() { let pool = &build_db_pool_for_tests().await; + let pool = &mut pool.into(); let inserted_instance = Instance::read_or_create(pool, "my_domain.tld".to_string()) .await