examples: improve client example

pull/9/head
Daniel Abramov 5 years ago committed by Sebastian Dröge
parent c02a5399b2
commit 40943ec32c
  1. 5
      examples/client.rs

@ -13,7 +13,6 @@
use std::env; use std::env;
use futures::{future, pin_mut, StreamExt}; use futures::{future, pin_mut, StreamExt};
use log::info;
use tungstenite::protocol::Message; use tungstenite::protocol::Message;
use async_std::io; use async_std::io;
@ -22,8 +21,6 @@ use async_std::task;
use async_tungstenite::async_std::connect_async; use async_tungstenite::async_std::connect_async;
async fn run() { async fn run() {
let _ = env_logger::try_init();
let connect_addr = env::args() let connect_addr = env::args()
.nth(1) .nth(1)
.unwrap_or_else(|| panic!("this program requires at least one argument")); .unwrap_or_else(|| panic!("this program requires at least one argument"));
@ -34,7 +31,7 @@ async fn run() {
task::spawn(read_stdin(stdin_tx)); task::spawn(read_stdin(stdin_tx));
let (ws_stream, _) = connect_async(url).await.expect("Failed to connect"); let (ws_stream, _) = connect_async(url).await.expect("Failed to connect");
info!("WebSocket handshake has been successfully completed"); println!("WebSocket handshake has been successfully completed");
let (write, read) = ws_stream.split(); let (write, read) = ws_stream.split();

Loading…
Cancel
Save