refactor(sliding sync): avoid an unwrap by inlining a function into its one caller

This commit is contained in:
Benjamin Bouvier
2025-06-26 11:09:59 +02:00
parent 836c643769
commit 70f48be582

View File

@@ -198,16 +198,9 @@ impl SlidingSyncResponseProcessor {
.await?;
handle_receipts_extension(&self.client, response, &mut sync_response).await?;
update_in_memory_caches(&self.client, &sync_response).await?;
self.response = Some(sync_response);
self.post_process().await
}
async fn post_process(&mut self) -> Result<()> {
// This is an internal API misuse if this is triggered (calling
// `handle_room_response` after this function), so panic is fine.
let response = self.response.as_ref().unwrap();
update_in_memory_caches(&self.client, response).await?;
Ok(())
}