From 089ab20e7c42bc8982f14e900a68a5d06e048add Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 23 Jun 2021 14:04:10 +0200 Subject: [PATCH] Re-format wasm_command_bot --- matrix_sdk/examples/wasm_command_bot/src/lib.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/matrix_sdk/examples/wasm_command_bot/src/lib.rs b/matrix_sdk/examples/wasm_command_bot/src/lib.rs index a94cafab..ddc6744b 100644 --- a/matrix_sdk/examples/wasm_command_bot/src/lib.rs +++ b/matrix_sdk/examples/wasm_command_bot/src/lib.rs @@ -60,7 +60,9 @@ impl WasmBot { for (room_id, room) in response.rooms.join { for event in room.timeline.events { - if let Ok(AnySyncRoomEvent::Message(AnySyncMessageEvent::RoomMessage(ev))) = event.event.deserialize() { + if let Ok(AnySyncRoomEvent::Message(AnySyncMessageEvent::RoomMessage(ev))) = + event.event.deserialize() + { self.on_room_message(&room_id, &ev).await } } @@ -81,19 +83,14 @@ pub async fn run() -> Result { let homeserver_url = Url::parse(&homeserver_url).unwrap(); let client = Client::new(homeserver_url).unwrap(); - client - .login(username, password, None, Some("rust-sdk-wasm")) - .await - .unwrap(); + client.login(username, password, None, Some("rust-sdk-wasm")).await.unwrap(); let bot = WasmBot(client.clone()); client.sync_once(SyncSettings::default()).await.unwrap(); let settings = SyncSettings::default().token(client.sync_token().await.unwrap()); - client - .sync_with_callback(settings, |response| bot.on_sync_response(response)) - .await; + client.sync_with_callback(settings, |response| bot.on_sync_response(response)).await; Ok(JsValue::NULL) }