return stream from multi_get_eventid_from_short

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-12-03 09:42:26 +00:00
parent 48703173bc
commit 784ccd6bad
5 changed files with 39 additions and 56 deletions

View file

@ -6,7 +6,11 @@ use std::{
sync::Arc,
};
use conduit::{debug, debug_error, trace, utils::IterStream, validated, warn, Err, Result};
use conduit::{
debug, debug_error, trace,
utils::{stream::ReadyExt, IterStream},
validated, warn, Err, Result,
};
use futures::{Stream, StreamExt};
use ruma::{EventId, RoomId};
@ -61,11 +65,10 @@ impl Service {
let event_ids = self
.services
.short
.multi_get_eventid_from_short(chain.into_iter())
.await
.into_iter()
.filter_map(Result::ok)
.collect();
.multi_get_eventid_from_short(chain.iter())
.ready_filter_map(Result::ok)
.collect()
.await;
Ok(event_ids)
}