@ -16,10 +16,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
println!("Sending: \"{}\"", text);
ws_stream.send(Message::text(text)).await?;
let msg = ws_stream
.next()
.await
.ok_or_else(|| "didn't receive anything")??;
let msg = ws_stream.next().await.ok_or("didn't receive anything")??;
println!("Received: {:?}", msg);
@ -11,10 +11,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
@ -22,10 +22,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
@ -394,5 +394,7 @@ pub(crate) fn port(
Some("ws") => Some(80),
_ => None,
})
.ok_or_else(|| tungstenite::Error::Url(tungstenite::error::UrlError::UnsupportedUrlScheme))
.ok_or(tungstenite::Error::Url(
tungstenite::error::UrlError::UnsupportedUrlScheme,
))
}