rustfmt
All checks were successful
CI / lint (push) Successful in 2m2s
CI / Build and test (, nightly) (push) Successful in 1m30s
CI / Build and test (, beta) (push) Successful in 4m2s
CI / Build and test (, 1.76.0) (push) Successful in 4m6s

This commit is contained in:
Val Lorentz 2024-02-11 14:19:18 +01:00
parent 5f38edcb3b
commit fab114459b

View File

@ -575,7 +575,12 @@ impl RoomBuffer {
let initial_roominfo_hash = hash_roominfo(room.clone_info());
let computed_roominfo = compute_room_info(room, initial_roominfo_hash).await;
tokio::task::spawn(update_roominfo_worker(room_id.clone(), initial_roominfo_hash, roominfo_rx, computed_roominfo_tx));
tokio::task::spawn(update_roominfo_worker(
room_id.clone(),
initial_roominfo_hash,
roominfo_rx,
computed_roominfo_tx,
));
let mut self_ = RoomBuffer {
config,
@ -652,7 +657,8 @@ impl Buffer for RoomBuffer {
fn short_name(&self) -> String {
self
.computed_roominfo
.display_name.as_ref()
.display_name
.as_ref()
.map(|dn| dn.to_string())
.unwrap_or_else(|| {
self
@ -675,13 +681,15 @@ impl Buffer for RoomBuffer {
fn parent(&self) -> Option<BufferId> {
self
.computed_roominfo
.parent.as_ref()
.parent
.as_ref()
.map(|parent| BufferId::Room(parent.clone()))
}
fn children(&self) -> Option<SortedVec<(BufferSortKey, BufferId)>> {
self
.computed_roominfo
.children.as_ref()
.children
.as_ref()
.map(|children: &SortedVec<_>| {
let children = children
.iter()
@ -773,10 +781,7 @@ impl Buffer for RoomBuffer {
}
fn fully_read(&self) -> FullyReadStatus {
match self
.computed_roominfo
.fully_read_at.as_ref()
{
match self.computed_roominfo.fully_read_at.as_ref() {
None => FullyReadStatus::All, // Unknown, assume it's read for now, we'll probably find out later
Some(fully_read_at) => {
// Iterate through all buffers, and if any buffer's last event is not the one where
@ -1015,10 +1020,9 @@ async fn update_roominfo_worker(
}
last_roominfo_hash = roominfo_hash;
tracing::trace!("visible change to {}", room_id);
let room = buf
.client
.get_room(&room_id)
.expect("client missing room");
computed_roominfo_tx.send(compute_room_info(room, roominfo_hash).await).expect("failed to send to computed_roominfo_tx");
let room = buf.client.get_room(&room_id).expect("client missing room");
computed_roominfo_tx
.send(compute_room_info(room, roominfo_hash).await)
.expect("failed to send to computed_roominfo_tx");
}
}