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

LengthDelimitedCodec should support [u8] #6895

Open
wraitii opened this issue Oct 10, 2024 · 0 comments
Open

LengthDelimitedCodec should support [u8] #6895

wraitii opened this issue Oct 10, 2024 · 0 comments
Labels
A-tokio-util Area: The tokio-util crate C-feature-request Category: A feature request. M-codec Module: tokio-util/codec

Comments

@wraitii
Copy link

wraitii commented Oct 10, 2024

Is your feature request related to a problem? Please describe.
LengthDelimitedCodec provides a default implementation of Encode for bytes::Bytes. This forces users to import bytes, when there is no reason not to provide Encode for [u8]

Furthermore, LengthDelimitedCodec makes it difficult to write your own Encode implementation as the length handling is manual, so using the default implementation should probably be strongly recommended.

Additional context
Would be willing to write a PR for this if the feature seems useful.

@wraitii wraitii added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Oct 10, 2024
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-codec Module: tokio-util/codec and removed A-tokio Area: The main tokio crate labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate C-feature-request Category: A feature request. M-codec Module: tokio-util/codec
Projects
None yet
Development

No branches or pull requests

2 participants