1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-08-06 17:40:59 +00:00

messing around with arcs

This commit is contained in:
Timo Kösters 2022-10-05 15:33:57 +02:00
parent 9b08525a18
commit 0f618de7fd
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
77 changed files with 598 additions and 434 deletions

View file

@ -20,9 +20,9 @@ pub use utils::error::{Error, Result};
pub use service::{Services, pdu::PduEvent};
pub use api::ruma_wrapper::{Ruma, RumaResponse};
pub static SERVICES: RwLock<Option<Arc<Services>>> = RwLock::new(None);
pub static SERVICES: RwLock<Option<&'static Services>> = RwLock::new(None);
pub fn services<'a>() -> Arc<Services> {
Arc::clone(&SERVICES.read().unwrap())
pub fn services<'a>() -> &'static Services {
&SERVICES.read().unwrap().expect("SERVICES should be initialized when this is called")
}