From fc5ef73a984b533d2dbe917fff3aa28678565cc8 Mon Sep 17 00:00:00 2001 From: dullbananas Date: Mon, 12 Jun 2023 03:50:03 +0000 Subject: [PATCH] clippy, fmt --- crates/api_crud/src/comment/update.rs | 2 +- crates/apub/src/objects/post.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/api_crud/src/comment/update.rs b/crates/api_crud/src/comment/update.rs index 730f6b3b8..027326d8b 100644 --- a/crates/api_crud/src/comment/update.rs +++ b/crates/api_crud/src/comment/update.rs @@ -68,7 +68,7 @@ impl PerformCrud for EditComment { let comment_id = data.comment_id; let form = CommentUpdateForm::builder() - .content(content_slurs_removed.map(|s| s.into_owned())) + .content(content_slurs_removed.map(std::borrow::Cow::into_owned)) .language_id(data.language_id) .updated(Some(Some(naive_now()))) .build(); diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index 34ecef4fa..42dbafff1 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -218,7 +218,7 @@ impl Object for ApubPost { PostInsertForm { name, url: url.map(Into::into), - body: body_slurs_removed.map(|s| s.into_owned()), + body: body_slurs_removed.map(std::borrow::Cow::into_owned), creator_id: creator.id, community_id: community.id, removed: None,