actix / actix-extras

A collection of additional crates supporting the actix and actix-web frameworks.
https://actix.rs
Apache License 2.0
787 stars 206 forks source link

Update websocket example to use futures_util::StreamExt #467

Closed MatthewSbar closed 2 months ago

MatthewSbar commented 2 months ago

The only way I was able to get this example code to run was by installing futures_util and importing futures_util::StreamExt. It feels like there isn't supposed to be an additional dependency here (I am relatively new to Rust let alone package management like this), but the example by itself throws an error without doing this.

PR Type

Other

PR Checklist

Overview

It's just an update to the example code

N/A to my knowledge

MatthewSbar commented 2 months ago

I recognize this probably isn't the correct-est solution, but I found merely pasting the example into a main.rs file and trying to do cargo run would give me this error, importing the futures_util package gave me the expected behavior. Maybe I'm doing something wrong 🙃, but, I wanted to try and do something more constructive than say "it doesn't work"

    |
115 |         while let Some(Ok(msg)) = msg_stream.next().await {
    |                                              ^^^^ method not found in `MessageStream`
    |
MatthewSbar commented 2 months ago

Oh looks like a fix was reported an hour ago and merged a few minutes ago. Closing.

robjtede commented 2 months ago

Yep sorry about this! Appreciate the PR regardless :)