From 02ce7bdc7d2df4fc2e5a0405496362faf31058ca Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 6 Nov 2021 15:01:00 +0100 Subject: [PATCH] Remove unused ActorType methods --- crates/apub/src/fetcher/user_or_community.rs | 8 -------- crates/apub/src/objects/community.rs | 6 ------ crates/apub/src/objects/person.rs | 6 ------ crates/apub_lib/src/traits.rs | 2 -- 4 files changed, 22 deletions(-) diff --git a/crates/apub/src/fetcher/user_or_community.rs b/crates/apub/src/fetcher/user_or_community.rs index eccda7c65..5f7c388ed 100644 --- a/crates/apub/src/fetcher/user_or_community.rs +++ b/crates/apub/src/fetcher/user_or_community.rs @@ -80,18 +80,10 @@ impl ApubObject for UserOrCommunity { } impl ActorType for UserOrCommunity { - fn is_local(&self) -> bool { - todo!() - } - fn actor_id(&self) -> Url { todo!() } - fn name(&self) -> String { - todo!() - } - fn public_key(&self) -> Option { match self { UserOrCommunity::User(p) => p.public_key(), diff --git a/crates/apub/src/objects/community.rs b/crates/apub/src/objects/community.rs index 35a19353f..f6737a3a8 100644 --- a/crates/apub/src/objects/community.rs +++ b/crates/apub/src/objects/community.rs @@ -161,15 +161,9 @@ impl ApubObject for ApubCommunity { } impl ActorType for ApubCommunity { - fn is_local(&self) -> bool { - self.local - } fn actor_id(&self) -> Url { self.actor_id.to_owned().into() } - fn name(&self) -> String { - self.name.clone() - } fn public_key(&self) -> Option { self.public_key.to_owned() } diff --git a/crates/apub/src/objects/person.rs b/crates/apub/src/objects/person.rs index 5f494b70f..ea0883214 100644 --- a/crates/apub/src/objects/person.rs +++ b/crates/apub/src/objects/person.rs @@ -178,15 +178,9 @@ impl ApubObject for ApubPerson { } impl ActorType for ApubPerson { - fn is_local(&self) -> bool { - self.local - } fn actor_id(&self) -> Url { self.actor_id.to_owned().into() } - fn name(&self) -> String { - self.name.clone() - } fn public_key(&self) -> Option { self.public_key.to_owned() diff --git a/crates/apub_lib/src/traits.rs b/crates/apub_lib/src/traits.rs index 18b33ba65..e5dcbc1ed 100644 --- a/crates/apub_lib/src/traits.rs +++ b/crates/apub_lib/src/traits.rs @@ -63,9 +63,7 @@ pub trait ApubObject { /// Common methods provided by ActivityPub actors (community and person). Not all methods are /// implemented by all actors. pub trait ActorType { - fn is_local(&self) -> bool; fn actor_id(&self) -> Url; - fn name(&self) -> String; // TODO: this should not be an option (needs db migration in lemmy) fn public_key(&self) -> Option;