summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorTimo Kösters <timo@koesters.xyz>2022-10-05 15:33:57 +0200
committerNyaaori <+@nyaaori.cat>2022-10-10 14:02:00 +0200
commitcff52d7ebb5066f3d8e513488b84a431c0093e65 (patch)
tree597e030b6f52c5282625a51fd0d7e0e799ea7e00 /src/lib.rs
parentface766e0f32481fd97a435f1ed8579d8cfc634c (diff)
downloadconduit-cff52d7ebb5066f3d8e513488b84a431c0093e65.zip
messing around with arcs
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 75cf6c7..c103d52 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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")
}