diff options
author | Timo Kösters <timo@koesters.xyz> | 2022-09-07 13:25:51 +0200 |
---|---|---|
committer | Nyaaori <+@nyaaori.cat> | 2022-10-10 13:54:00 +0200 |
commit | bd8b616ca01983b5f029095e168146693ffe9dcd (patch) | |
tree | d0b8fcbc0fce57ddaefa90f2ccefc843485624be /src/lib.rs | |
parent | 785ddfc4aae1ccd5e8ef8b796bb634b876e14cf8 (diff) | |
download | conduit-bd8b616ca01983b5f029095e168146693ffe9dcd.zip |
Fixed more compile time errors
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -13,7 +13,7 @@ mod service; pub mod api; mod utils; -use std::cell::Cell; +use std::{cell::Cell, sync::RwLock}; pub use config::Config; pub use utils::error::{Error, Result}; @@ -22,13 +22,13 @@ pub use api::ruma_wrapper::{Ruma, RumaResponse}; use crate::database::KeyValueDatabase; -pub static SERVICES: Cell<Option<ServicesEnum>> = Cell::new(None); +pub static SERVICES: RwLock<Option<ServicesEnum>> = RwLock::new(None); enum ServicesEnum { Rocksdb(Services<KeyValueDatabase>) } -pub fn services() -> Services { - SERVICES.get().unwrap() +pub fn services() -> Services<KeyValueDatabase> { + SERVICES.read().unwrap() } |