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

Clarify ReadBuf::uninit allows initialized buffers as well #7053

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zacknewman
Copy link

Motivation

The documentation for ReadBuf::uninit makes it seem as though the passed buffer must be fully uninitialized; however it allows any buffer, a subset of which is fully uninitialized memory.

Note this is more for people like me who are deficient in unsafe code; thus the original documentation is likely obvious for those who are well acquainted with unsafe code.

Solution

State the buffer may be fully uninitialized.

@Darksonn Darksonn added T-docs Topic: documentation A-tokio Area: The main tokio crate M-io Module: tokio/io labels Dec 29, 2024
tokio/src/io/read_buf.rs Outdated Show resolved Hide resolved
tokio/src/io/read_buf.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-io Module: tokio/io T-docs Topic: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants