diff options
author | Timo Kösters <timo@koesters.xyz> | 2022-10-05 15:33:57 +0200 |
---|---|---|
committer | Nyaaori <+@nyaaori.cat> | 2022-10-10 14:02:00 +0200 |
commit | cff52d7ebb5066f3d8e513488b84a431c0093e65 (patch) | |
tree | 597e030b6f52c5282625a51fd0d7e0e799ea7e00 /src/lib.rs | |
parent | face766e0f32481fd97a435f1ed8579d8cfc634c (diff) | |
download | conduit-cff52d7ebb5066f3d8e513488b84a431c0093e65.zip |
messing around with arcs
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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") } |