Refactor for structured insertions

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk authored and strawberry committed 2024-10-26 18:50:29 -04:00
1 parent 8258d16a94
commit 2ed0c267eb
31 files changed
+364 -621

No files matched your search

+4 -4
View File
@@ -64,9 +64,9 @@ pub fn iter_ids(&self) -> impl Stream<Item = &RoomId> + Send + '_ { self.db.room
#[inline]
pub fn disable_room(&self, room_id: &RoomId, disabled: bool) {
if disabled {
self.db.disabledroomids.insert(room_id.as_bytes(), &[]);
self.db.disabledroomids.insert(room_id, []);
} else {
self.db.disabledroomids.remove(room_id.as_bytes());
self.db.disabledroomids.remove(room_id);
}
}
@@ -74,9 +74,9 @@ pub fn disable_room(&self, room_id: &RoomId, disabled: bool) {
#[inline]
pub fn ban_room(&self, room_id: &RoomId, banned: bool) {
if banned {
self.db.bannedroomids.insert(room_id.as_bytes(), &[]);
self.db.bannedroomids.insert(room_id, []);
} else {
self.db.bannedroomids.remove(room_id.as_bytes());
self.db.bannedroomids.remove(room_id);
}
}