mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-10 00:48:44 -04:00
refactor(sliding sync): avoid an unwrap by inlining a function into its one caller
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user