Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update websocket example to use futures_util::StreamExt #467

Closed
wants to merge 1 commit into from

Conversation

MatthewSbar
Copy link

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

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the nightly rustfmt (cargo +nightly fmt).

Overview

It's just an update to the example code

N/A to my knowledge

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.
@MatthewSbar
Copy link
Author

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
Copy link
Author

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

@robjtede
Copy link
Member

Yep sorry about this! Appreciate the PR regardless :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants