From 3bbee92db483a016841c388712b40105fae99ab2 Mon Sep 17 00:00:00 2001 From: Lambda Date: Sun, 10 Aug 2025 16:26:44 +0000 Subject: [PATCH] MSC3575: remove useless Ok-wrapping --- src/api/client_server/sync/msc3575.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/api/client_server/sync/msc3575.rs b/src/api/client_server/sync/msc3575.rs index 7d748e42..55ed37a8 100644 --- a/src/api/client_server/sync/msc3575.rs +++ b/src/api/client_server/sync/msc3575.rs @@ -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