From ccd3c8a3f29598883b56190d38b35df73c95e379 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Tue, 3 May 2022 01:17:27 +0900 Subject: [PATCH] Don't implement activitypub's Object for Source --- plume-common/src/activity_pub/mod.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/plume-common/src/activity_pub/mod.rs b/plume-common/src/activity_pub/mod.rs index 3b421206..f2d1da06 100644 --- a/plume-common/src/activity_pub/mod.rs +++ b/plume-common/src/activity_pub/mod.rs @@ -1,11 +1,11 @@ -use activitypub::{Link, Object}; +use activitypub::Link; use activitystreams::{ actor::{ApActor, Group, Person}, base::{AnyBase, Base, Extends}, iri_string::types::IriString, kind, markers::{self, Activity}, - object::{ApObject, Article, Object as Object07}, + object::{ApObject, Article, Object}, primitives::{AnyString, OneOrMany}, unparsed::UnparsedMutExt, }; @@ -287,7 +287,7 @@ pub struct Hashtag { pub name: Option, #[serde(flatten)] - inner: Object07, + inner: Object, } impl Hashtag { @@ -295,18 +295,18 @@ impl Hashtag { Self { href: None, name: None, - inner: Object07::new(), + inner: Object::new(), } } - pub fn extending(mut inner: Object07) -> Result { + pub fn extending(mut inner: Object) -> Result { let href = inner.remove("href")?; let name = inner.remove("name")?; Ok(Self { href, name, inner }) } - pub fn retracting(self) -> Result, serde_json::Error> { + pub fn retracting(self) -> Result, serde_json::Error> { let Self { href, name, @@ -389,7 +389,7 @@ impl Extends for Hashtag { type Error = serde_json::Error; fn extends(base: Base) -> Result { - let inner = Object07::extends(base)?; + let inner = Object::extends(base)?; Self::extending(inner) } @@ -411,8 +411,6 @@ pub struct Source { pub content: String, } -impl Object for Source {} - impl UnparsedExtension for Source where U: UnparsedMutExt,