MSC3575: remove useless Ok-wrapping

This commit is contained in:
Lambda 2025-08-10 16:26:44 +00:00
parent e75fe7b75a
commit 3bbee92db4

View file

@ -455,15 +455,13 @@ pub(crate) async fn sync_events_v4_route(
let prev_batch = timeline_pdus
.first()
.map_or(Ok::<_, Error>(None), |(pdu_count, _)| {
Ok(Some(match pdu_count {
PduCount::Backfilled(_) => {
error!("Timeline in backfill state?!");
"0".to_owned()
}
PduCount::Normal(c) => c.to_string(),
}))
})?
.map(|(pdu_count, _)| match pdu_count {
PduCount::Backfilled(_) => {
error!("Timeline in backfill state?!");
"0".to_owned()
}
PduCount::Normal(c) => c.to_string(),
})
.or_else(|| (roomsince != &0).then(|| roomsince.to_string()));
let room_events: Vec<_> = timeline_pdus