summaryrefslogtreecommitdiffstats
path: root/server/src/api/post.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/post.rs
parentdbc62a1b32f760a66421a2c75c0b935e2f01d45e (diff)
Switching to shorthands for rust params.
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r--server/src/api/post.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs
index 5b41b426..4855865b 100644
--- a/server/src/api/post.rs
+++ b/server/src/api/post.rs
@@ -134,7 +134,7 @@ impl Perform<PostResponse> for Oper<CreatePost> {
// They like their own post by default
let like_form = PostLikeForm {
post_id: inserted_post.id,
- user_id: user_id,
+ user_id,
score: 1,
};
@@ -198,10 +198,10 @@ impl Perform<GetPostResponse> for Oper<GetPost> {
Ok(GetPostResponse {
op: self.op.to_string(),
post: post_view,
- comments: comments,
- community: community,
- moderators: moderators,
- admins: admins,
+ comments,
+ community,
+ moderators,
+ admins,
})
}
}
@@ -248,7 +248,7 @@ impl Perform<GetPostsResponse> for Oper<GetPosts> {
Ok(GetPostsResponse {
op: self.op.to_string(),
- posts: posts,
+ posts,
})
}
}
@@ -278,7 +278,7 @@ impl Perform<CreatePostLikeResponse> for Oper<CreatePostLike> {
let like_form = PostLikeForm {
post_id: data.post_id,
- user_id: user_id,
+ user_id,
score: data.score,
};
@@ -417,7 +417,7 @@ impl Perform<PostResponse> for Oper<SavePost> {
let post_saved_form = PostSavedForm {
post_id: data.post_id,
- user_id: user_id,
+ user_id,
};
if data.save {