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

Use first nonempty buffer in vectored I/O #1998

Merged
merged 1 commit into from Dec 10, 2019

Conversation

@tmiasko
Copy link

tmiasko commented Dec 7, 2019

Previous implementation would use the first buffer even when it was
empty and other nonempty buffers are provided. This could result in
Ok(0) return value which has otherwise a special meaning. The new
implementation uses the first nonempty buffer instead to avoid the
issue.

Previous implementation would return early if no buffers are provided.
The new implementation delegates operation using an empty buffer. This
gives an implementation an ability to decide how an empty read / write
operation should behave.

This change aligns the implementation with synchronous version of those
traits.

Tomasz Miąsko
Previous implementation would use the first buffer even when it was
empty and other nonempty buffers are provided. This could result in
`Ok(0)` return value which has otherwise a special meaning. The new
implementation uses the first nonempty buffer instead to avoid the
issue.

Previous implementation would return early if no buffers are provided.
The new implementation delegates operation using an empty buffer. This
gives an implementation an ability to decide how an empty read / write
operation should behave.

This change aligns the implementation with synchronous version of those
traits.
@cramertj

This comment has been minimized.

Copy link
Member

cramertj commented Dec 10, 2019

Thanks!

@cramertj cramertj merged commit 06098e4 into rust-lang:master Dec 10, 2019
1 check failed
1 check failed
Travis CI - Pull Request Build Errored
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.