- let read = move |mut conn: DbConn<'a>,
- (post_id, my_person_id, is_mod_or_admin): (
- PostId,
- Option<PersonId>,
- Option<bool>,
- )| async move {
- // The left join below will return None in this case
- let person_id_join = my_person_id.unwrap_or(PersonId(-1));
-
- let mut query = all_joins(
- post_aggregates::table
- .filter(post_aggregates::post_id.eq(post_id))
- .into_boxed(),
- my_person_id,
- )
- .select(selection);
+ let read =
+ move |mut conn: DbConn<'a>,
+ (post_id, my_person_id, is_mod_or_admin): (PostId, Option<PersonId>, bool)| async move {
+ // The left join below will return None in this case
+ let person_id_join = my_person_id.unwrap_or(PersonId(-1));
+
+ let mut query = all_joins(
+ post_aggregates::table
+ .filter(post_aggregates::post_id.eq(post_id))
+ .into_boxed(),
+ my_person_id,
+ )
+ .select(selection);