-impl ViewToVec for PersonMentionView {
- type DbTuple = PersonMentionViewTuple;
- fn from_tuple_to_vec(items: Vec<Self::DbTuple>) -> Vec<Self> {
- items
- .into_iter()
- .map(|a| Self {
- person_mention: a.0,
- comment: a.1,
- creator: a.2,
- post: a.3,
- community: a.4,
- recipient: a.5,
- counts: a.6,
- creator_banned_from_community: a.7.is_some(),
- subscribed: CommunityFollower::to_subscribed_type(&a.8),
- saved: a.9.is_some(),
- creator_blocked: a.10.is_some(),
- my_vote: a.11,
- })
- .collect::<Vec<Self>>()
+impl JoinView for PersonMentionView {
+ type JoinTuple = PersonMentionViewTuple;
+ fn from_tuple(a: Self::JoinTuple) -> Self {
+ Self {
+ person_mention: a.0,
+ comment: a.1,
+ creator: a.2,
+ post: a.3,
+ community: a.4,
+ recipient: a.5,
+ counts: a.6,
+ creator_banned_from_community: a.7.is_some(),
+ subscribed: CommunityFollower::to_subscribed_type(&a.8),
+ saved: a.9.is_some(),
+ creator_blocked: a.10.is_some(),
+ my_vote: a.11,
+ }