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

Unnecessary Sized constraint on BufMut::put method? #612

Open
GrizzlT opened this issue May 8, 2023 · 1 comment
Open

Unnecessary Sized constraint on BufMut::put method? #612

GrizzlT opened this issue May 8, 2023 · 1 comment

Comments

@GrizzlT
Copy link

GrizzlT commented May 8, 2023

When using this crate I noticed that the BufMut::put method requires Self to be Sized.

This makes it difficult for me to use that function in ?Sized contexts for better optimizations. Is there a reason
this trait bound is necessary?

I looked at BufMut::put and BufMut::put_slice and it seems that neither method uses functions that require Self: Sized while put does require Sized and put_slice does not. Could the trait bound be removed from the api?

@GrizzlT GrizzlT changed the title Unnecessary Sized constraint on BufMut:: Unnecessary Sized constraint on BufMut::put method May 8, 2023
@GrizzlT GrizzlT changed the title Unnecessary Sized constraint on BufMut::put method Unnecessary Sized constraint on BufMut::put method? May 8, 2023
@ObsidianMinor
Copy link

BufMut::put is generic, which means it can't be used in an unsized context anyway.

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

No branches or pull requests

2 participants