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

Make the cast in Bidirectional stream smaller #387

Merged
merged 1 commit into from
Jul 6, 2020
Merged

Make the cast in Bidirectional stream smaller #387

merged 1 commit into from
Jul 6, 2020

Conversation

dvtkrlbs
Copy link

@dvtkrlbs dvtkrlbs commented Jul 5, 2020

Since we already define the type we can just use it instead of writing it again

Motivation

The example on the bidirectional streaming is confusing since we are casting the output
of Box::pin() to a type. However it is the same type as the associated type RouteChatStream.
It makes the code more clean and understandable.

Solution

Use the associated type instead of writing the type again.

Since we already define the type we can just use it instead of writing it again
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

👍 good idea! Thanks!

@LucioFranco LucioFranco merged commit 9c954e0 into hyperium:master Jul 6, 2020
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