chore: silenced unused warnings

This commit is contained in:
əlemi 2024-05-27 16:58:51 +02:00
parent 8712b5e723
commit 40f12ec636
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 5 additions and 8 deletions

View file

@ -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 model;
mod routes; mod routes;

View file

@ -48,24 +48,20 @@ impl Identity {
} }
} }
#[allow(unused)]
pub fn is_anon(&self) -> bool { pub fn is_anon(&self) -> bool {
matches!(self, Self::Anonymous) matches!(self, Self::Anonymous)
} }
#[allow(unused)]
pub fn is_local(&self) -> bool { pub fn is_local(&self) -> bool {
matches!(self, Self::Local { .. }) matches!(self, Self::Local { .. })
} }
#[allow(unused)]
pub fn is_remote(&self) -> bool { pub fn is_remote(&self) -> bool {
matches!(self, Self::Remote { .. }) 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); pub struct AuthIdentity(pub Identity);

View file

@ -188,6 +188,7 @@ impl Context {
Ok(model::activity::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) 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<bool> { pub async fn is_local_internal_actor(&self, internal: i64) -> crate::Result<bool> {
Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some()) Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some())
} }