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

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

zacknewman
Copy link
Contributor

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
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 merged commit 463502c into tokio-rs:master Jan 6, 2025
81 checks passed
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