Fix a couple of clippy warnings

pull/83/head 0.13.0
Sebastian Dröge 4 years ago
parent 842fbb895f
commit 1170f4e080
  1. 5
      examples/async-std-echo.rs
  2. 5
      examples/gio-echo.rs
  3. 5
      examples/tokio-echo.rs
  4. 4
      src/lib.rs

@ -16,10 +16,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
println!("Sending: \"{}\"", text); println!("Sending: \"{}\"", text);
ws_stream.send(Message::text(text)).await?; ws_stream.send(Message::text(text)).await?;
let msg = ws_stream let msg = ws_stream.next().await.ok_or("didn't receive anything")??;
.next()
.await
.ok_or_else(|| "didn't receive anything")??;
println!("Received: {:?}", msg); println!("Received: {:?}", msg);

@ -11,10 +11,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
println!("Sending: \"{}\"", text); println!("Sending: \"{}\"", text);
ws_stream.send(Message::text(text)).await?; ws_stream.send(Message::text(text)).await?;
let msg = ws_stream let msg = ws_stream.next().await.ok_or("didn't receive anything")??;
.next()
.await
.ok_or_else(|| "didn't receive anything")??;
println!("Received: {:?}", msg); println!("Received: {:?}", msg);

@ -22,10 +22,7 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
println!("Sending: \"{}\"", text); println!("Sending: \"{}\"", text);
ws_stream.send(Message::text(text)).await?; ws_stream.send(Message::text(text)).await?;
let msg = ws_stream let msg = ws_stream.next().await.ok_or("didn't receive anything")??;
.next()
.await
.ok_or_else(|| "didn't receive anything")??;
println!("Received: {:?}", msg); println!("Received: {:?}", msg);

@ -394,5 +394,7 @@ pub(crate) fn port(
Some("ws") => Some(80), Some("ws") => Some(80),
_ => None, _ => None,
}) })
.ok_or_else(|| tungstenite::Error::Url(tungstenite::error::UrlError::UnsupportedUrlScheme)) .ok_or(tungstenite::Error::Url(
tungstenite::error::UrlError::UnsupportedUrlScheme,
))
} }

Loading…
Cancel
Save