From 9791607793ede97a43cc681936391b34d8da7fe4 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Tue, 3 May 2022 01:20:40 +0900 Subject: [PATCH] Rename: with07() -> with() --- plume-common/src/activity_pub/inbox.rs | 22 +++++++++++----------- plume-models/src/inbox.rs | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/plume-common/src/activity_pub/inbox.rs b/plume-common/src/activity_pub/inbox.rs index 1bc886c3..0b681274 100644 --- a/plume-common/src/activity_pub/inbox.rs +++ b/plume-common/src/activity_pub/inbox.rs @@ -197,7 +197,7 @@ where } /// Registers an handler on this Inbox. - pub fn with07(self, proxy: Option<&reqwest::Proxy>) -> Self + pub fn with(self, proxy: Option<&reqwest::Proxy>) -> Self where A: AsActor<&'a C> + FromId, V: activitystreams::markers::Activity + serde::de::DeserializeOwned, @@ -742,7 +742,7 @@ mod tests { fn test_inbox_basic07() { let act = serde_json::to_value(build_create07()).unwrap(); let res: Result<(), ()> = Inbox::handle(&(), act) - .with07::(None) + .with::(None) .done(); assert!(res.is_ok()); } @@ -751,10 +751,10 @@ mod tests { fn test_inbox_multi_handlers07() { let act = serde_json::to_value(build_create()).unwrap(); let res: Result<(), ()> = Inbox::handle(&(), act) - .with07::(None) - .with07::(None) - .with07::(None) - .with07::(None) + .with::(None) + .with::(None) + .with::(None) + .with::(None) .done(); assert!(res.is_ok()); } @@ -764,8 +764,8 @@ mod tests { let act = serde_json::to_value(build_create07()).unwrap(); // Create is not handled by this inbox let res: Result<(), ()> = Inbox::handle(&(), act) - .with07::(None) - .with07::(None) + .with::(None) + .with::(None) .done(); assert!(res.is_err()); } @@ -818,13 +818,13 @@ mod tests { let act = serde_json::to_value(build_create07()).unwrap(); let res: Result<(), ()> = Inbox::handle(&(), act.clone()) - .with07::(None) + .with::(None) .done(); assert!(res.is_err()); let res: Result<(), ()> = Inbox::handle(&(), act.clone()) - .with07::(None) - .with07::(None) + .with::(None) + .with::(None) .done(); assert!(res.is_ok()); } diff --git a/plume-models/src/inbox.rs b/plume-models/src/inbox.rs index 9368f5be..86472590 100644 --- a/plume-models/src/inbox.rs +++ b/plume-models/src/inbox.rs @@ -51,18 +51,18 @@ impl_into_inbox_result! { pub fn inbox(conn: &DbConn, act: serde_json::Value) -> Result { Inbox::handle(conn, act) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) - .with07::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) + .with::(CONFIG.proxy()) .done() }