|
|
@ -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); |
|
|
|
|
|
|
|
|
|
|
|