From 0ab7774e290ca919859e11215da680805383d921 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 2 May 2022 17:43:03 +0900 Subject: [PATCH] Rename: AsObject07 -> AsObject --- plume-common/src/activity_pub/inbox.rs | 14 +++++++------- plume-models/src/comments.rs | 6 +++--- plume-models/src/follows.rs | 6 +++--- plume-models/src/likes.rs | 6 +++--- plume-models/src/posts.rs | 8 ++++---- plume-models/src/reshares.rs | 6 +++--- plume-models/src/users.rs | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/plume-common/src/activity_pub/inbox.rs b/plume-common/src/activity_pub/inbox.rs index be28eac2..4751588f 100644 --- a/plume-common/src/activity_pub/inbox.rs +++ b/plume-common/src/activity_pub/inbox.rs @@ -201,7 +201,7 @@ where where A: AsActor<&'a C> + FromId, V: activitystreams::markers::Activity + serde::de::DeserializeOwned, - M: AsObject07 + FromId, + M: AsObject + FromId, M::Output: Into, { if let Self::NotHandled(ctx, mut act, e) = self { @@ -519,7 +519,7 @@ pub trait AsActor { /// } /// } /// ``` -pub trait AsObject07 +pub trait AsObject where V: activitystreams::markers::Activity, { @@ -646,7 +646,7 @@ mod tests { &*MY_SIGNER } } - impl AsObject07 for MyObject07 { + impl AsObject for MyObject07 { type Error = (); type Output = (); @@ -661,7 +661,7 @@ mod tests { } } - impl AsObject07 for MyObject07 { + impl AsObject for MyObject07 { type Error = (); type Output = (); @@ -676,7 +676,7 @@ mod tests { } } - impl AsObject07 for MyObject07 { + impl AsObject for MyObject07 { type Error = (); type Output = (); @@ -691,7 +691,7 @@ mod tests { } } - impl AsObject07 for MyObject07 { + impl AsObject for MyObject07 { type Error = (); type Output = (); @@ -798,7 +798,7 @@ mod tests { } } - impl AsObject07 for MyObject07 { + impl AsObject for MyObject07 { type Error = (); type Output = (); diff --git a/plume-models/src/comments.rs b/plume-models/src/comments.rs index 7c2864ce..e37273c4 100644 --- a/plume-models/src/comments.rs +++ b/plume-models/src/comments.rs @@ -30,7 +30,7 @@ use chrono::{self, NaiveDateTime, TimeZone, Utc}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; use plume_common::{ activity_pub::{ - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, sign::Signer, Id, IntoId, ToAsString, ToAsUri, PUBLIC_VISIBILITY, }, @@ -431,7 +431,7 @@ impl FromId for Comment { } } -impl AsObject07 for Comment { +impl AsObject for Comment { type Error = Error; type Output = Self; @@ -441,7 +441,7 @@ impl AsObject07 for Comment { } } -impl AsObject07 for Comment { +impl AsObject for Comment { type Error = Error; type Output = (); diff --git a/plume-models/src/follows.rs b/plume-models/src/follows.rs index a4094802..6876328a 100644 --- a/plume-models/src/follows.rs +++ b/plume-models/src/follows.rs @@ -12,7 +12,7 @@ use activitystreams::{ use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; use plume_common::activity_pub::{ broadcast, broadcast07, - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, sign::Signer, Id, IntoId, PUBLIC_VISIBILITY, }; @@ -242,7 +242,7 @@ impl Follow { } } -impl AsObject07 for User { +impl AsObject for User { type Error = Error; type Output = Follow; @@ -296,7 +296,7 @@ impl FromId for Follow { } } -impl AsObject07 for Follow { +impl AsObject for Follow { type Error = Error; type Output = (); diff --git a/plume-models/src/likes.rs b/plume-models/src/likes.rs index 07760edf..59a0d6bf 100644 --- a/plume-models/src/likes.rs +++ b/plume-models/src/likes.rs @@ -12,7 +12,7 @@ use activitystreams::{ use chrono::NaiveDateTime; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use plume_common::activity_pub::{ - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, sign::Signer, Id, IntoId, PUBLIC_VISIBILITY, }; @@ -118,7 +118,7 @@ impl Like { } } -impl AsObject07 for Post { +impl AsObject for Post { type Error = Error; type Output = Like; @@ -187,7 +187,7 @@ impl FromId for Like { } } -impl AsObject07 for Like { +impl AsObject for Like { type Error = Error; type Output = (); diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index 4cd6c648..267fa925 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -26,7 +26,7 @@ use diesel::{self, BelongingToDsl, ExpressionMethods, QueryDsl, RunQueryDsl}; use once_cell::sync::Lazy; use plume_common::{ activity_pub::{ - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, sign::Signer, Hashtag, Hashtag07, HashtagType07, Id, IntoId, Licensed, Licensed07, LicensedArticle as LicensedArticle07, Source, SourceProperty, ToAsString, ToAsUri, @@ -1054,7 +1054,7 @@ impl FromId for Post { } } -impl AsObject07 for Post { +impl AsObject for Post { type Error = Error; type Output = Self; @@ -1064,7 +1064,7 @@ impl AsObject07 for Post { } } -impl AsObject07 for Post { +impl AsObject for Post { type Error = Error; type Output = (); @@ -1149,7 +1149,7 @@ impl FromId for PostUpdate { } } -impl AsObject07 for PostUpdate { +impl AsObject for PostUpdate { type Error = Error; type Output = (); diff --git a/plume-models/src/reshares.rs b/plume-models/src/reshares.rs index 419e19d3..1e023cd4 100644 --- a/plume-models/src/reshares.rs +++ b/plume-models/src/reshares.rs @@ -12,7 +12,7 @@ use activitystreams::{ use chrono::NaiveDateTime; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use plume_common::activity_pub::{ - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, sign::Signer, Id, IntoId, PUBLIC_VISIBILITY, }; @@ -144,7 +144,7 @@ impl Reshare { } } -impl AsObject07 for Post { +impl AsObject for Post { type Error = Error; type Output = Reshare; @@ -214,7 +214,7 @@ impl FromId for Reshare { } } -impl AsObject07 for Reshare { +impl AsObject for Reshare { type Error = Error; type Output = (); diff --git a/plume-models/src/users.rs b/plume-models/src/users.rs index 09345c98..e224b553 100644 --- a/plume-models/src/users.rs +++ b/plume-models/src/users.rs @@ -35,7 +35,7 @@ use openssl::{ }; use plume_common::{ activity_pub::{ - inbox::{AsActor, AsObject07, FromId}, + inbox::{AsActor, AsObject, FromId}, request::get, sign::{gen_keypair, Error as SignError, Result as SignResult, Signer}, ActivityStream, ApSignature, ApSignature07, CustomPerson as CustomPerson07, Id, IntoId, @@ -1248,7 +1248,7 @@ impl AsActor<&DbConn> for User { } } -impl AsObject07 for User { +impl AsObject for User { type Error = Error; type Output = ();