From 40f12ec6369ed653feb747f808041c633a507166 Mon Sep 17 00:00:00 2001 From: alemi Date: Mon, 27 May 2024 16:58:51 +0200 Subject: [PATCH] chore: silenced unused warnings --- src/main.rs | 2 +- src/server/auth.rs | 10 +++------- src/server/context.rs | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index c1e7446f..3a8e12a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -pub mod server; // TODO there are some methods that i dont use yet, make it public so that ra shuts up +mod server; mod model; mod routes; diff --git a/src/server/auth.rs b/src/server/auth.rs index 2eddd9d5..cacf2cca 100644 --- a/src/server/auth.rs +++ b/src/server/auth.rs @@ -48,24 +48,20 @@ impl Identity { } } + #[allow(unused)] pub fn is_anon(&self) -> bool { matches!(self, Self::Anonymous) } + #[allow(unused)] pub fn is_local(&self) -> bool { matches!(self, Self::Local { .. }) } + #[allow(unused)] pub fn is_remote(&self) -> bool { matches!(self, Self::Remote { .. }) } - - pub fn is_local_user(&self, uid: &str) -> bool { - match self { - Self::Local { id, .. } => id == uid, - _ => false, - } - } } pub struct AuthIdentity(pub Identity); diff --git a/src/server/context.rs b/src/server/context.rs index 1db4b344..2b023864 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -188,6 +188,7 @@ impl Context { Ok(model::activity::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) } + #[allow(unused)] pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result { Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) }