Skip to content

fix: read upto EOF in uncompress #91

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

Merged
merged 1 commit into from
May 5, 2024

Conversation

rishadbaniya
Copy link
Contributor

@rishadbaniya rishadbaniya commented May 5, 2024

btw this wasn't an assigned task, i was curious on the uncompress and it seems it didn't read upto EOF with those dynamic code size(i.e n_bits), So this fixes it and i also added some comments, there were a lot of bitwise operation, so i thought it needed some comments

…on by reading upto EOF with a read trait object wrapper
@jgarzik
Copy link
Contributor

jgarzik commented May 5, 2024

  1. Very nice! This is helpful, thanks. merged.
  2. Protip: It might be possible to use an existing crate for the Read-N-Bits and Write-N-Bits operations. Other file formats such as audio and video codecs have "stream of 10-bit codes" type of patterns. I meant to research this. "bitstream" might be a good search word.

@jgarzik jgarzik merged commit ea45d49 into rustcoreutils:main May 5, 2024
@jgarzik jgarzik added the bug Something isn't working label May 5, 2024
@rishadbaniya
Copy link
Contributor Author

@jgarzik, i did have the thought of looking up, but the "zero dependency goal" thing hit my head and had to go with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants