From 3c50dba3f83b8ab5c38b00af1d7ce12fe2c8475f Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 31 May 2024 00:11:03 +0200 Subject: [PATCH] fix: trait signatures --- src/server/fetcher.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/server/fetcher.rs b/src/server/fetcher.rs index f892841..1460aa5 100644 --- a/src/server/fetcher.rs +++ b/src/server/fetcher.rs @@ -16,14 +16,6 @@ pub enum PullResult { Object(T), } -impl PullResult { - pub fn inner(self) -> T { - match self { - Self::Actor(x) | Self::Activity(x) | Self::Object(x) => x - } - } -} - impl PullResult { pub fn actor(self) -> crate::Result { match self { @@ -48,21 +40,12 @@ impl PullResult { Self::Object(x) => Ok(x), } } - - pub async fn resolve(self, ctx: &(impl Fetcher + Sync)) -> crate::Result<()> { - match self { - Self::Actor(x) => { ctx.resolve_user(x).await?; }, - Self::Object(x) => { ctx.resolve_object(x).await?; }, - Self::Activity(x) => { ctx.resolve_activity(x).await?; }, - } - Ok(()) - } } #[axum::async_trait] pub trait Fetcher { async fn pull(&self, id: &str) -> crate::Result> { self.pull_r(id, 0).await } - async fn pull_r(&self, id: &str, depth: i32) -> crate::Result>; + async fn pull_r(&self, id: &str, depth: u32) -> crate::Result>; async fn webfinger(&self, user: &str, host: &str) -> crate::Result;