diff options
author | Paweł Dybiec <pawel@dybiec.info> | 2022-12-27 17:47:24 +0000 |
---|---|---|
committer | Paweł Dybiec <pawel@dybiec.info> | 2022-12-27 17:50:29 +0000 |
commit | c23b1ecb97ee16d4b2ecb2d9a97b39778d30f2ef (patch) | |
tree | aee90b17c0e4274ba4f9afbf6d67eac0d60fba76 /src/mattermost/client.rs | |
parent | Handle shutdown gracefully (diff) |
format
Diffstat (limited to 'src/mattermost/client.rs')
-rw-r--r-- | src/mattermost/client.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mattermost/client.rs b/src/mattermost/client.rs index 6025970..3d59837 100644 --- a/src/mattermost/client.rs +++ b/src/mattermost/client.rs @@ -56,7 +56,10 @@ impl Client { } async fn get_working_ws_stream( &self, - ) -> Result<async_tungstenite::WebSocketStream<async_tungstenite::tokio::ConnectStream>, anyhow::Error> { + ) -> Result< + async_tungstenite::WebSocketStream<async_tungstenite::tokio::ConnectStream>, + anyhow::Error, + > { let url = format!("{}/api/v4/websocket", self.url.replacen("http", "ws", 1)); let token = self .bearer_token @@ -76,7 +79,7 @@ impl Client { handler: T, mut shutdown: tokio::sync::mpsc::UnboundedReceiver<()>, ) -> Result<(), anyhow::Error> { - let mut ws_stream=self.get_working_ws_stream().await?; + let mut ws_stream = self.get_working_ws_stream().await?; loop { tokio::select! { message = ws_stream.next() => { |