From ffc3493abed7cc2f901f228a2c66cb740214e0c3 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 1 Jan 2025 12:47:21 -0500 Subject: [PATCH] Applying some clippy fixes. (#5292) --- crates/api_crud/src/post/create.rs | 2 +- crates/apub/src/activities/block/block_user.rs | 2 +- crates/apub/src/activities/block/undo_block_user.rs | 2 +- crates/apub/src/activities/community/update.rs | 4 ++-- crates/apub/src/objects/comment.rs | 4 ++-- crates/apub/src/objects/person.rs | 4 ++-- crates/apub/src/objects/post.rs | 4 ++-- crates/apub/src/objects/private_message.rs | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/api_crud/src/post/create.rs b/crates/api_crud/src/post/create.rs index 948a7617e..452144faa 100644 --- a/crates/api_crud/src/post/create.rs +++ b/crates/api_crud/src/post/create.rs @@ -107,7 +107,7 @@ pub async fn create_post( let scheduled_publish_time = convert_published_time(data.scheduled_publish_time, &local_user_view, &context).await?; let post_form = PostInsertForm { - url: url.map(Into::into), + url, body, alt_text: data.alt_text.clone(), nsfw: data.nsfw, diff --git a/crates/apub/src/activities/block/block_user.rs b/crates/apub/src/activities/block/block_user.rs index 64c402482..14b9f9adc 100644 --- a/crates/apub/src/activities/block/block_user.rs +++ b/crates/apub/src/activities/block/block_user.rs @@ -152,7 +152,7 @@ impl ActivityHandler for BlockUser { #[tracing::instrument(skip_all)] async fn receive(self, context: &Data) -> LemmyResult<()> { insert_received_activity(&self.id, context).await?; - let expires = self.end_time.map(Into::into); + let expires = self.end_time; let mod_person = self.actor.dereference(context).await?; let blocked_person = self.object.dereference(context).await?; let target = self.target.dereference(context).await?; diff --git a/crates/apub/src/activities/block/undo_block_user.rs b/crates/apub/src/activities/block/undo_block_user.rs index 122eae429..55715fd30 100644 --- a/crates/apub/src/activities/block/undo_block_user.rs +++ b/crates/apub/src/activities/block/undo_block_user.rs @@ -100,7 +100,7 @@ impl ActivityHandler for UndoBlockUser { #[tracing::instrument(skip_all)] async fn receive(self, context: &Data) -> LemmyResult<()> { insert_received_activity(&self.id, context).await?; - let expires = self.object.end_time.map(Into::into); + let expires = self.object.end_time; let mod_person = self.actor.dereference(context).await?; let blocked_person = self.object.object.dereference(context).await?; match self.object.target.dereference(context).await? { diff --git a/crates/apub/src/activities/community/update.rs b/crates/apub/src/activities/community/update.rs index fadf918bd..b6bc50ca0 100644 --- a/crates/apub/src/activities/community/update.rs +++ b/crates/apub/src/activities/community/update.rs @@ -98,8 +98,8 @@ impl ActivityHandler for UpdateCommunity { &None, &self.object.source, )), - published: self.object.published.map(Into::into), - updated: Some(self.object.updated.map(Into::into)), + published: self.object.published, + updated: Some(self.object.updated), nsfw: Some(self.object.sensitive.unwrap_or(false)), actor_id: Some(self.object.id.into()), public_key: Some(self.object.public_key.public_key_pem), diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index 2c8ed9f9d..ed9a9e1a2 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -194,8 +194,8 @@ impl Object for ApubComment { post_id: post.id, content, removed: None, - published: note.published.map(Into::into), - updated: note.updated.map(Into::into), + published: note.published, + updated: note.updated, deleted: Some(false), ap_id: Some(note.id.into()), distinguished: note.distinguished, diff --git a/crates/apub/src/objects/person.rs b/crates/apub/src/objects/person.rs index 97b83c194..50f8e8563 100644 --- a/crates/apub/src/objects/person.rs +++ b/crates/apub/src/objects/person.rs @@ -167,8 +167,8 @@ impl Object for ApubPerson { deleted: Some(false), avatar, banner, - published: person.published.map(Into::into), - updated: person.updated.map(Into::into), + published: person.published, + updated: person.updated, actor_id: Some(person.id.into()), bio, local: Some(false), diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index bcd1dbf8e..0dd9201c2 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -249,8 +249,8 @@ impl Object for ApubPost { url: url.map(Into::into), body, alt_text, - published: page.published.map(Into::into), - updated: page.updated.map(Into::into), + published: page.published, + updated: page.updated, deleted: Some(false), nsfw: page.sensitive, ap_id: Some(page.id.clone().into()), diff --git a/crates/apub/src/objects/private_message.rs b/crates/apub/src/objects/private_message.rs index ec3e16fac..521419c82 100644 --- a/crates/apub/src/objects/private_message.rs +++ b/crates/apub/src/objects/private_message.rs @@ -166,8 +166,8 @@ impl Object for ApubPrivateMessage { creator_id: creator.id, recipient_id: recipient.id, content, - published: note.published.map(Into::into), - updated: note.updated.map(Into::into), + published: note.published, + updated: note.updated, deleted: Some(false), read: None, ap_id: Some(note.id.into()),