mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 07:36:01 +00:00
Remove unnecessary clone (#2874)
Co-authored-by: KyP <phanky.vn@proton.me>
This commit is contained in:
parent
82d93da26b
commit
4a70502007
|
@ -72,8 +72,7 @@ impl Perform for CreateCommentLike {
|
|||
// Only add the like if the score isnt 0
|
||||
let do_add = like_form.score != 0 && (like_form.score == 1 || like_form.score == -1);
|
||||
if do_add {
|
||||
let like_form2 = like_form.clone();
|
||||
CommentLike::like(context.pool(), &like_form2)
|
||||
CommentLike::like(context.pool(), &like_form)
|
||||
.await
|
||||
.map_err(|e| LemmyError::from_error_message(e, "couldnt_like_comment"))?;
|
||||
}
|
||||
|
|
|
@ -60,8 +60,7 @@ impl Perform for CreatePostLike {
|
|||
// Only add the like if the score isnt 0
|
||||
let do_add = like_form.score != 0 && (like_form.score == 1 || like_form.score == -1);
|
||||
if do_add {
|
||||
let like_form2 = like_form.clone();
|
||||
PostLike::like(context.pool(), &like_form2)
|
||||
PostLike::like(context.pool(), &like_form)
|
||||
.await
|
||||
.map_err(|e| LemmyError::from_error_message(e, "couldnt_like_post"))?;
|
||||
}
|
||||
|
|
|
@ -107,9 +107,8 @@ impl PerformCrud for CreateComment {
|
|||
.build();
|
||||
|
||||
// Create the comment
|
||||
let comment_form2 = comment_form.clone();
|
||||
let parent_path = parent_opt.clone().map(|t| t.path);
|
||||
let inserted_comment = Comment::create(context.pool(), &comment_form2, parent_path.as_ref())
|
||||
let inserted_comment = Comment::create(context.pool(), &comment_form, parent_path.as_ref())
|
||||
.await
|
||||
.map_err(|e| LemmyError::from_error_message(e, "couldnt_create_comment"))?;
|
||||
|
||||
|
|
Loading…
Reference in a new issue