summaryrefslogtreecommitdiff
path: root/src/database/key_value/rooms/state.rs
diff options
context:
space:
mode:
authorTimo Kösters <timo@koesters.xyz>2022-10-05 20:34:31 +0200
committerNyaaori <+@nyaaori.cat>2022-10-10 14:02:01 +0200
commita4637e2ba1093065a6fda3fa2ad2b2b9f30eea63 (patch)
tree2d31313957d699875fc61f570686318b523ae0f1 /src/database/key_value/rooms/state.rs
parent33a2b2b7729bb40253fd174d99ad773869b5ecfe (diff)
downloadconduit-a4637e2ba1093065a6fda3fa2ad2b2b9f30eea63.zip
cargo fmt
Diffstat (limited to 'src/database/key_value/rooms/state.rs')
-rw-r--r--src/database/key_value/rooms/state.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/database/key_value/rooms/state.rs b/src/database/key_value/rooms/state.rs
index 90ac0d5..80a7458 100644
--- a/src/database/key_value/rooms/state.rs
+++ b/src/database/key_value/rooms/state.rs
@@ -1,10 +1,10 @@
-use ruma::{RoomId, EventId};
-use tokio::sync::MutexGuard;
-use std::sync::Arc;
+use ruma::{EventId, RoomId};
use std::collections::HashSet;
use std::fmt::Debug;
+use std::sync::Arc;
+use tokio::sync::MutexGuard;
-use crate::{service, database::KeyValueDatabase, utils, Error, Result};
+use crate::{database::KeyValueDatabase, service, utils, Error, Result};
impl service::rooms::state::Data for KeyValueDatabase {
fn get_room_shortstatehash(&self, room_id: &RoomId) -> Result<Option<u64>> {
@@ -17,9 +17,12 @@ impl service::rooms::state::Data for KeyValueDatabase {
})
}
- fn set_room_state(&self, room_id: &RoomId, new_shortstatehash: u64,
+ fn set_room_state(
+ &self,
+ room_id: &RoomId,
+ new_shortstatehash: u64,
_mutex_lock: &MutexGuard<'_, ()>, // Take mutex guard to make sure users get the room state mutex
- ) -> Result<()> {
+ ) -> Result<()> {
self.roomid_shortstatehash
.insert(room_id.as_bytes(), &new_shortstatehash.to_be_bytes())?;
Ok(())