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

tokio-util: Remove Encoder bound on FramedParts constructor #5280

Merged
merged 1 commit into from
Dec 9, 2022
Merged

tokio-util: Remove Encoder bound on FramedParts constructor #5280

merged 1 commit into from
Dec 9, 2022

Conversation

mattfbacon
Copy link
Contributor

@mattfbacon mattfbacon commented Dec 9, 2022

Motivation

I cannot construct FramedParts in order to construct Framed if my codec doesn't implement Encoder<I> for some I, despite the fact that I can create a Framed for the same codec, and it will simply not implement Sink.

Solution

Remove the bound.

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-codec Module: tokio-util/codec labels Dec 9, 2022
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn enabled auto-merge (squash) December 9, 2022 10:50
@Darksonn Darksonn merged commit ae69d11 into tokio-rs:master Dec 9, 2022
@arcnmx
Copy link

arcnmx commented Feb 11, 2023

Is this not a major breaking change warranting an 0.8? The parameter couldn't be inferred previously, so it was always necessary to explicitly pass it using new::<X>(...) - and now that the parameter was removed, any code using the prior version will no longer compile after a cargo update

@Darksonn
Copy link
Contributor

Yeah, you are right. Removing a where bound is not a breaking change under normal circumstances, and I didn't notice that this particular case had a special generic paramter...

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 M-codec Module: tokio-util/codec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants