]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/fetcher/post_or_comment.rs
Make functions work with both connection and pool (#3420)
[lemmy.git] / crates / apub / src / fetcher / post_or_comment.rs
index 651abf7db90bcc41c1fd7676352a07b4f20a642c..9291496690609743b38b5d1a4b6d719780353fe9 100644 (file)
@@ -91,8 +91,12 @@ impl InCommunity for PostOrComment {
   async fn community(&self, context: &Data<LemmyContext>) -> Result<ApubCommunity, LemmyError> {
     let cid = match self {
       PostOrComment::Post(p) => p.community_id,
-      PostOrComment::Comment(c) => Post::read(context.pool(), c.post_id).await?.community_id,
+      PostOrComment::Comment(c) => {
+        Post::read(&mut context.pool(), c.post_id)
+          .await?
+          .community_id
+      }
     };
-    Ok(Community::read(context.pool(), cid).await?.into())
+    Ok(Community::read(&mut context.pool(), cid).await?.into())
   }
 }