diff --git a/matrix_sdk/Cargo.toml b/matrix_sdk/Cargo.toml index 62452356..b15d84d7 100644 --- a/matrix_sdk/Cargo.toml +++ b/matrix_sdk/Cargo.toml @@ -72,7 +72,6 @@ version = "3.0.2" features = ["wasm-bindgen"] [dev-dependencies] -async-std = { version = "1.9.0", features = ["unstable"] } dirs = "3.0.1" matrix-sdk-test = { version = "0.2.0", path = "../matrix_sdk_test" } tokio = { version = "1.1.0", default-features = false, features = ["rt-multi-thread", "macros"] } diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 016da325..b52f4bea 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -1702,11 +1702,10 @@ impl Client { /// the interesting events through a mpsc channel to another thread e.g. a /// UI thread. /// - /// ```compile_fail,E0658 + /// ```no_run /// # use matrix_sdk::events::{ /// # room::message::{MessageEvent, MessageEventContent, TextMessageEventContent}, /// # }; - /// # use matrix_sdk::Room; /// # use std::sync::{Arc, RwLock}; /// # use std::time::Duration; /// # use matrix_sdk::{Client, SyncSettings, LoopCtrl}; @@ -1716,7 +1715,7 @@ impl Client { /// # let homeserver = Url::parse("http://localhost:8080").unwrap(); /// # let mut client = Client::new(homeserver).unwrap(); /// - /// use async_std::sync::channel; + /// use tokio::sync::mpsc::channel; /// /// let (tx, rx) = channel(100); /// @@ -1725,14 +1724,12 @@ impl Client { /// .timeout(Duration::from_secs(30)); /// /// client - /// .sync_with_callback(sync_settings, async move |response| { + /// .sync_with_callback(sync_settings, |response| async move { /// let channel = sync_channel; /// /// for (room_id, room) in response.rooms.join { /// for event in room.timeline.events { - /// if let Ok(e) = event.deserialize() { - /// channel.send(e).await; - /// } + /// channel.send(event).await.unwrap(); /// } /// } ///