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

fix: incorrect read_slice impl for ReadAdapter #309

Merged
merged 2 commits into from
Sep 7, 2024

Commits on Sep 6, 2024

  1. fix: incorrect read_slice impl for ReadAdapter

    This commit fixes a bug that is present in the implementation of
    ByteReader for ReadAdapter. Specifically, it does not consume any input,
    so calling `read_slice` and then attempting to read the next value in
    the input, will read the same bytes again. The documented behavior of
    this function is that any of the `read_*` methods consume the
    corresponding amount of input.
    
    To catch this, and to prevent future regressions, a new test was added
    that serializes some data to a file using one approach, and deserializes
    it using the ReadAdapter. This ensures that we don't accidentally make
    choices in the writer that aren't matched by the reader, and vice versa.
    
    Closes facebook#308
    bitwalker committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    ae9824d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ec52b24 View commit details
    Browse the repository at this point in the history