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

docs: BytesMut::with_capacity does not guarantee exact capacity #5870

Merged
merged 1 commit into from Aug 16, 2023

Conversation

mahkoh
Copy link
Contributor

@mahkoh mahkoh commented Jul 16, 2023

Motivation

The documentation implies that BytesMut::with_capacity can be used in protocols that need to read exact numbers of bytes (and where read_exact is too inefficient.) This is incorrect as described in the commit message.

Solution

Adjust the documentation.

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

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

Nice, thanks.

@carllerche carllerche merged commit 718dcc8 into tokio-rs:master Aug 16, 2023
70 checks passed
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.

None yet

2 participants