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

Do not error out of g{read,write}_with if the offset is equal to slice len #94

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

RaitoBezarius
Copy link
Contributor

Retake of #81.

It does not allow reading zero-sized types (like possibly an empty array) from empty slice

Contains documentation in the Pread and Pwrite trait, test is fixed.

…e len

It does not allow reading zero-sized types (like possibly an empty array) from empty slice

Co-authored-by: Raito Bezarius <[email protected]>
Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

Thanks for adding the documentation; I'd have preferred an additional test writing e.g., zero length slices and reading out zero length slices, but it's fine

@m4b m4b merged commit aa8df8e into m4b:master Nov 21, 2023
6 checks passed
m4b pushed a commit that referenced this pull request Dec 31, 2023
…et is equal to slice len (#94)

We now allow reading zero-sized types (like possibly an empty array) from empty slice, or the exact end of a byte array,
and similarly, one can write a empty string or byte array into the tail end of a byte array (i.e., write nothing to nothing).

Co-authored-by: Nickie S <[email protected]>
@m4b
Copy link
Owner

m4b commented Jan 1, 2024

released in 0.12.0, happy new year!

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.

3 participants