From 4fe6191aa3607988ce4b4510cbcdc9d0e65676a0 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Sun, 21 Aug 2022 09:51:34 -0700 Subject: [PATCH] chore: formatting --- rustfmt.toml | 2 +- src/main.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rustfmt.toml b/rustfmt.toml index 32a9786..3a26366 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1 +1 @@ -edition = "2018" +edition = "2021" diff --git a/src/main.rs b/src/main.rs index 9e208a3..85d46d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -468,8 +468,9 @@ async fn nostr_server( Some(Ok(Message::Text(m))) => { convert_to_msg(m) }, - Some(Ok(Message::Binary(_))) => { - ws_stream.send(make_notice_message("binary messages are not accepted")).await.ok(); + Some(Ok(Message::Binary(_))) => { + ws_stream.send( + make_notice_message("binary messages are not accepted")).await.ok(); continue; }, Some(Ok(Message::Ping(_))) | Some(Ok(Message::Pong(_))) => { @@ -477,8 +478,10 @@ async fn nostr_server( // send responses automatically. continue; }, - Some(Err(WsError::Capacity(MessageTooLong{size, max_size}))) => { - ws_stream.send(make_notice_message(&format!("message too large ({} > {})",size, max_size))).await.ok(); + Some(Err(WsError::Capacity(MessageTooLong(size, max_size)))) => { + ws_stream.send( + make_notice_message( + &format!("message too large ({} > {})",size, max_size))).await.ok(); continue; }, None |