diff --git a/examples/async-std-echo.rs b/examples/async-std-echo.rs index e08e5cb..99502ca 100644 --- a/examples/async-std-echo.rs +++ b/examples/async-std-echo.rs @@ -16,10 +16,7 @@ async fn run() -> Result<(), Box> { 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); diff --git a/examples/gio-echo.rs b/examples/gio-echo.rs index bcc5399..b5c0370 100644 --- a/examples/gio-echo.rs +++ b/examples/gio-echo.rs @@ -11,10 +11,7 @@ async fn run() -> Result<(), Box> { 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); diff --git a/examples/tokio-echo.rs b/examples/tokio-echo.rs index d4ed890..ee27c94 100644 --- a/examples/tokio-echo.rs +++ b/examples/tokio-echo.rs @@ -22,10 +22,7 @@ async fn run() -> Result<(), Box> { 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); diff --git a/src/lib.rs b/src/lib.rs index 8501978..85e86c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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, + )) }