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

Simplify websockets_chat example to avoid unnecessary Result. #885

Merged
merged 1 commit into from
Jul 31, 2021

Conversation

yaymukund
Copy link
Contributor

When I used the websockets example, I found myself wondering why you need to send(Ok(Message...)) rather than send(Message...). It turns out stream.forward() is only implemented on TryStreamExt.

So I rewrote the example to use send() which avoids the unnecessary Result.

UnboundedSender<Result<Message, warp::Error>> becomes
UnboundedSender<Message>
@yaymukund yaymukund changed the title Simplify websockets example to avoid unnecessary Result. Simplify websockets_chat example to avoid unnecessary Result. Jul 28, 2021
serprex added a commit to serprex/openEtG that referenced this pull request Jul 30, 2021
serprex added a commit to serprex/openEtG that referenced this pull request Jul 31, 2021
Copy link
Collaborator

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jxs jxs merged commit ffe49ab into seanmonstar:master Jul 31, 2021
@yaymukund yaymukund deleted the websockets-chat-refactor branch July 31, 2021 13:57
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