Add missing .awaits in event handler doctests

This commit is contained in:
Jonas Platte 2021-09-08 23:25:16 +02:00
parent ce0cb273bb
commit 8c499a63dc
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67

View file

@ -921,10 +921,10 @@ impl Client {
/// |ev: SyncMessageEvent<MessageEventContent>, room: Room, client: Client| async move { /// |ev: SyncMessageEvent<MessageEventContent>, room: Room, client: Client| async move {
/// // Common usage: Room event plus room and client. /// // Common usage: Room event plus room and client.
/// }, /// },
/// ); /// ).await;
/// client.register_event_handler(|ev: SyncStateEvent<TopicEventContent>| async move { /// client.register_event_handler(|ev: SyncStateEvent<TopicEventContent>| async move {
/// // Also possible: Omit any or all arguments after the first. /// // Also possible: Omit any or all arguments after the first.
/// }); /// }).await;
/// ///
/// // Custom events work exactly the same way, you just need to declare the content struct and /// // Custom events work exactly the same way, you just need to declare the content struct and
/// // use the EventContent derive macro on it. /// // use the EventContent derive macro on it.
@ -940,7 +940,7 @@ impl Client {
/// |ev: SyncMessageEvent<TokenEventContent>, room: Room| async move { /// |ev: SyncMessageEvent<TokenEventContent>, room: Room| async move {
/// todo!("Display the token"); /// todo!("Display the token");
/// }, /// },
/// ); /// ).await;
/// ``` /// ```
pub async fn register_event_handler<Ev, Ctx, H>(&self, handler: H) pub async fn register_event_handler<Ev, Ctx, H>(&self, handler: H)
where where