Cleanup the examples a little bit
They run fine without this code.
This commit is contained in:
parent
a0ce0a9da8
commit
5fb288fc66
@ -21,16 +21,9 @@ use tokio_core::reactor::Core;
|
||||
use url::Url;
|
||||
|
||||
// from https://stackoverflow.com/a/43992218/1592377
|
||||
#[macro_export]
|
||||
macro_rules! clone {
|
||||
(@param _) => ( _ );
|
||||
(@param $x:ident) => ( $x );
|
||||
($($n:ident),+ => move || $body:expr) => (
|
||||
{
|
||||
$( let $n = $n.clone(); )+
|
||||
move || $body
|
||||
}
|
||||
);
|
||||
($($n:ident),+ => move |$($p:tt),+| $body:expr) => (
|
||||
{
|
||||
$( let $n = $n.clone(); )+
|
||||
@ -42,7 +35,7 @@ macro_rules! clone {
|
||||
fn hello_world(
|
||||
homeserver_url: Url,
|
||||
room: String,
|
||||
) -> impl Future<Item = (), Error = ruma_client::Error> + 'static {
|
||||
) -> impl Future<Item = (), Error = ruma_client::Error> {
|
||||
let client = Client::https(homeserver_url, None).unwrap();
|
||||
|
||||
client.register_guest().and_then(clone!(client => move |_| {
|
||||
|
@ -25,7 +25,7 @@ use url::Url;
|
||||
fn hello_world(
|
||||
homeserver_url: Url,
|
||||
room: String,
|
||||
) -> impl Future<Item = (), Error = ruma_client::Error> + 'static {
|
||||
) -> impl Future<Item = (), Error = ruma_client::Error> {
|
||||
let client = Client::https(homeserver_url, None).unwrap();
|
||||
|
||||
async_block! {
|
||||
|
Loading…
x
Reference in New Issue
Block a user