Refactor for structured insertions
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
8258d16a94
commit
2ed0c267eb
31 changed files with 364 additions and 621 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue