Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraef committed Jun 13, 2024
1 parent bace532 commit d9d9338
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,13 @@ mod tests {
#[tokio::test]
async fn test_send_close_frame() {
let mut websocket = websocket("https://echo.websocket.org/").await.unwrap();
websocket.send(Message::Close { code: CloseCode::Normal, reason: "Can you please reply with a close frame?".into() }).await.unwrap();
websocket
.send(Message::Close {
code: CloseCode::Normal,
reason: "Can you please reply with a close frame?".into(),
})
.await
.unwrap();

let mut close_received = false;
while let Some(message) = websocket.try_next().await.unwrap() {
Expand Down
4 changes: 3 additions & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ impl Sink<Message> for WebSysWebSocketStream {
match item {
Message::Text(text) => self.inner.send_with_str(&text)?,
Message::Binary(data) => self.inner.send_with_u8_array(&data)?,
Message::Close { code, reason } => self.inner.close_with_code_and_reason(code.into(), &reason)?,
Message::Close { code, reason } => self
.inner
.close_with_code_and_reason(code.into(), &reason)?,
#[allow(deprecated)]
Message::Ping(_) | Message::Pong(_) => {
// ignored!
Expand Down

0 comments on commit d9d9338

Please sign in to comment.