From: Felix Ableitner Date: Mon, 8 Nov 2021 12:11:24 +0000 (+0100) Subject: Fix clippy error X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%24%7BappleTouchIcon%7D?a=commitdiff_plain;h=252d87d33201818079d7ea5c59f207dbb085235d;p=lemmy.git Fix clippy error --- diff --git a/crates/apub/src/activities/community/update.rs b/crates/apub/src/activities/community/update.rs index b4ffb7fc..cc82c9e3 100644 --- a/crates/apub/src/activities/community/update.rs +++ b/crates/apub/src/activities/community/update.rs @@ -80,7 +80,7 @@ impl ActivityHandler for UpdateCommunity { ) -> Result<(), LemmyError> { let community = self.get_community(context, request_counter).await?; - let updated_community = self.object.into_form()?; + let updated_community = self.object.into_form(); let cf = CommunityForm { name: updated_community.name, title: updated_community.title, diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index 21ca9d4f..f2fb45e4 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -139,7 +139,7 @@ impl ApubObject for ApubCommunity { context: &LemmyContext, request_counter: &mut i32, ) -> Result { - let form = Group::into_form(group.clone())?; + let form = Group::into_form(group.clone()); // Fetching mods and outbox is not necessary for Lemmy to work, so ignore errors. Besides, // we need to ignore these errors so that tests can work entirely offline. diff --git a/crates/apub/src/protocol/objects/group.rs b/crates/apub/src/protocol/objects/group.rs index 8a6e6720..4dc1c5bd 100644 --- a/crates/apub/src/protocol/objects/group.rs +++ b/crates/apub/src/protocol/objects/group.rs @@ -68,8 +68,8 @@ impl Group { Ok(()) } - pub(crate) fn into_form(self) -> Result { - Ok(CommunityForm { + pub(crate) fn into_form(self) -> CommunityForm { + CommunityForm { name: self.preferred_username, title: self.name, description: get_summary_from_string_or_source(&self.summary, &self.source), @@ -88,6 +88,6 @@ impl Group { followers_url: Some(self.followers.into()), inbox_url: Some(self.inbox.into()), shared_inbox_url: Some(self.endpoints.shared_inbox.map(|s| s.into())), - }) + } } }