forked from alemi/upub
chore: silenced unused warnings
This commit is contained in:
parent
8712b5e723
commit
40f12ec636
3 changed files with 5 additions and 8 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<bool> {
|
||||
Ok(model::actor::Entity::find_by_id(internal).select_only().one(self.db()).await?.is_some())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue