|
14 | 14 |
|
15 | 15 | //! Facilities to edit existing events.
|
16 | 16 |
|
| 17 | +use std::future::Future; |
| 18 | + |
17 | 19 | use matrix_sdk_base::deserialized_responses::SyncTimelineEvent;
|
18 | 20 | use ruma::{
|
19 | 21 | events::{
|
@@ -88,14 +90,13 @@ impl Room {
|
88 | 90 | }
|
89 | 91 | }
|
90 | 92 |
|
91 |
| -#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] |
92 |
| -#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] |
93 | 93 | trait EventSource {
|
94 |
| - async fn get_event(&self, event_id: &EventId) -> Result<SyncTimelineEvent, EditError>; |
| 94 | + fn get_event( |
| 95 | + &self, |
| 96 | + event_id: &EventId, |
| 97 | + ) -> impl Future<Output = Result<SyncTimelineEvent, EditError>> + Send; |
95 | 98 | }
|
96 | 99 |
|
97 |
| -#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] |
98 |
| -#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] |
99 | 100 | impl<'a> EventSource for &'a Room {
|
100 | 101 | async fn get_event(&self, event_id: &EventId) -> Result<SyncTimelineEvent, EditError> {
|
101 | 102 | match self.event_cache().await {
|
@@ -225,8 +226,6 @@ mod tests {
|
225 | 226 | events: BTreeMap<OwnedEventId, SyncTimelineEvent>,
|
226 | 227 | }
|
227 | 228 |
|
228 |
| - #[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] |
229 |
| - #[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] |
230 | 229 | impl EventSource for TestEventCache {
|
231 | 230 | async fn get_event(&self, event_id: &EventId) -> Result<SyncTimelineEvent, EditError> {
|
232 | 231 | Ok(self.events.get(event_id).unwrap().clone())
|
|
0 commit comments