From e0f20ba0d013cf1dc809e875ad7a0cd4abe72421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sommer?= Date: Tue, 22 Jan 2019 10:38:31 +0100 Subject: [PATCH] Use tokio for hello_world example The crate tokio-core is deprecated. --- Cargo.toml | 2 +- examples/hello_world.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df4b21fc..4ae23b40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ version = "0.2.2" [dev-dependencies] ruma-events = "0.11.0" -tokio-core = "0.1.17" +tokio = "0.1" [features] default = ["tls"] diff --git a/examples/hello_world.rs b/examples/hello_world.rs index ad8caafd..da322634 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -9,7 +9,6 @@ use ruma_events::{ EventType, }; use ruma_identifiers::RoomAliasId; -use tokio_core::reactor::Core; use url::Url; // from https://stackoverflow.com/a/43992218/1592377 @@ -66,8 +65,6 @@ fn main() { } }; - Core::new() - .unwrap() - .run(hello_world(homeserver_url.parse().unwrap(), room)) - .unwrap(); + tokio::run(hello_world(homeserver_url.parse().unwrap(), room) + .map_err(|e| { dbg!(e); () })); }