Use self instead of going through services()

This commit is contained in:
Lambda 2024-09-01 11:35:02 +00:00
parent f52cf53931
commit 341f4213d0
8 changed files with 26 additions and 60 deletions

View file

@ -11,7 +11,7 @@ use ruma::{
};
use tokio::sync::RwLock;
use crate::{services, Result};
use crate::Result;
/// Compiled regular expressions for a namespace.
#[derive(Clone, Debug)]
@ -160,15 +160,9 @@ impl Service {
&self,
service_name: &str,
) -> Result<()> {
services()
.appservice
.registration_info
.write()
.await
.remove(service_name)
.ok_or_else(|| {
crate::Error::AdminCommand("Appservice not found")
})?;
self.registration_info.write().await.remove(service_name).ok_or_else(
|| crate::Error::AdminCommand("Appservice not found"),
)?;
self.db.unregister_appservice(service_name)
}