summaryrefslogtreecommitdiffstats
path: root/server/src/api/community.rs
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-12-09 11:08:19 -0800
committerDessalines <tyhou13@gmx.com>2019-12-09 11:08:19 -0800
commitfaef62e073086b3fbc11ee36bde0e8e8c96e24a6 (patch)
tree0d09924fb6bda1cd30af25dda6862e970fa3c45b /server/src/api/community.rs
parentdbc62a1b32f760a66421a2c75c0b935e2f01d45e (diff)
Switching to shorthands for rust params.
Diffstat (limited to 'server/src/api/community.rs')
-rw-r--r--server/src/api/community.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/server/src/api/community.rs b/server/src/api/community.rs
index 5bd60007..9492d75d 100644
--- a/server/src/api/community.rs
+++ b/server/src/api/community.rs
@@ -163,8 +163,8 @@ impl Perform<GetCommunityResponse> for Oper<GetCommunity> {
Ok(GetCommunityResponse {
op: self.op.to_string(),
community: community_view,
- moderators: moderators,
- admins: admins,
+ moderators,
+ admins,
})
}
}
@@ -213,7 +213,7 @@ impl Perform<CommunityResponse> for Oper<CreateCommunity> {
let community_moderator_form = CommunityModeratorForm {
community_id: inserted_community.id,
- user_id: user_id,
+ user_id,
};
let _inserted_community_moderator =
@@ -229,7 +229,7 @@ impl Perform<CommunityResponse> for Oper<CreateCommunity> {
let community_follower_form = CommunityFollowerForm {
community_id: inserted_community.id,
- user_id: user_id,
+ user_id,
};
let _inserted_community_follower =
@@ -310,7 +310,7 @@ impl Perform<CommunityResponse> for Oper<EditCommunity> {
community_id: data.edit_id,
removed: Some(removed),
reason: data.reason.to_owned(),
- expires: expires,
+ expires,
};
ModRemoveCommunity::create(&conn, &form)?;
}
@@ -360,7 +360,7 @@ impl Perform<ListCommunitiesResponse> for Oper<ListCommunities> {
// Return the jwt
Ok(ListCommunitiesResponse {
op: self.op.to_string(),
- communities: communities,
+ communities,
})
}
}
@@ -379,7 +379,7 @@ impl Perform<CommunityResponse> for Oper<FollowCommunity> {
let community_follower_form = CommunityFollowerForm {
community_id: data.community_id,
- user_id: user_id,
+ user_id,
};
if data.follow {
@@ -424,7 +424,7 @@ impl Perform<GetFollowedCommunitiesResponse> for Oper<GetFollowedCommunities> {
// Return the jwt
Ok(GetFollowedCommunitiesResponse {
op: self.op.to_string(),
- communities: communities,
+ communities,
})
}
}
@@ -470,7 +470,7 @@ impl Perform<BanFromCommunityResponse> for Oper<BanFromCommunity> {
community_id: data.community_id,
reason: data.reason.to_owned(),
banned: Some(data.ban),
- expires: expires,
+ expires,
};
ModBanFromCommunity::create(&conn, &form)?;
@@ -536,7 +536,7 @@ impl Perform<AddModToCommunityResponse> for Oper<AddModToCommunity> {
Ok(AddModToCommunityResponse {
op: self.op.to_string(),
- moderators: moderators,
+ moderators,
})
}
}
@@ -641,8 +641,8 @@ impl Perform<GetCommunityResponse> for Oper<TransferCommunity> {
Ok(GetCommunityResponse {
op: self.op.to_string(),
community: community_view,
- moderators: moderators,
- admins: admins,
+ moderators,
+ admins,
})
}
}