Skip to content

Commit e471496

Browse files
committed
paginator: don't use async_trait for PaginableRoom
This divides compile times for matrix-sdk by 2, on my machine (33 seconds -> 16).
1 parent 35db26b commit e471496

File tree

2 files changed

+159
-139
lines changed

2 files changed

+159
-139
lines changed

crates/matrix-sdk-ui/src/timeline/tests/mod.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
use std::{
1818
collections::{BTreeMap, HashMap},
19+
future::Future,
1920
sync::Arc,
2021
};
2122

@@ -303,20 +304,21 @@ impl TestRoomDataProvider {
303304
}
304305
}
305306

306-
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
307-
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
308307
impl PaginableRoom for TestRoomDataProvider {
309-
async fn event_with_context(
308+
fn event_with_context(
310309
&self,
311310
_event_id: &EventId,
312311
_lazy_load_members: bool,
313312
_num_events: UInt,
314-
) -> Result<EventWithContextResponse, PaginatorError> {
315-
unimplemented!();
313+
) -> impl Future<Output = Result<EventWithContextResponse, PaginatorError>> {
314+
async { unimplemented!() }
316315
}
317316

318-
async fn messages(&self, _opts: MessagesOptions) -> Result<Messages, PaginatorError> {
319-
unimplemented!();
317+
fn messages(
318+
&self,
319+
_opts: MessagesOptions,
320+
) -> impl Future<Output = Result<Messages, PaginatorError>> {
321+
async { unimplemented!() }
320322
}
321323
}
322324

0 commit comments

Comments
 (0)