-
Notifications
You must be signed in to change notification settings - Fork 143
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
Simplify and encapsulate ReadDecoder
implementation
#523
Simplify and encapsulate ReadDecoder
implementation
#523
Commits on Oct 9, 2024
-
Explicitly handle when
Reader.finish
is called twice.Before this commit calling `Reader.finish` a 2nd time would return a random, accidental error (`UnexpectedEof`), because of how `StreamingDecoder`'s `state` is set after processing the `IEND` chunk. After this commit, `Reader.finish` will handle this condition explicitly, in a similar same way to how `next_frame` handles being called when we have already consumed all the frames.
Configuration menu - View commit details
-
Copy full SHA for 7b7d1ff - Browse repository at this point
Copy the full SHA 7b7d1ffView commit details -
Stop tracking
ReadDecoder::at_eof
.After a recent commit, all public APIs of a `Reader` take care of not going beyond the `IEND` chunk and returning `PolledAfterEndOfImage` instead. This means that tracking `at_eof` at the level of `ReadDecoder` is obsolete and leads to unnecessary complexity. This commit refactors away this complexity.
Configuration menu - View commit details
-
Copy full SHA for c21cac9 - Browse repository at this point
Copy the full SHA c21cac9View commit details -
Reuse
ReadDecoder::decode_next
fromfinish_decoding
.`ReadDecoder::finish_decoding` now reuses `decode_next` instead of duplicating some of its code. Some duplication (e.g. handling of `Decoded::Nothing` remains - this will be taken care of in a subsequent commit).
Configuration menu - View commit details
-
Copy full SHA for f578e4c - Browse repository at this point
Copy the full SHA f578e4cView commit details -
Only call
decode_next
from otherReadDecoder
methods.This commit means that `decode_next` can be a private method of `ReadDecoder` (this is not enforced yet, before a subsequent commit moves `ReadDecoder` into a separate `mod`ule).
Configuration menu - View commit details
-
Copy full SHA for 4cdd51c - Browse repository at this point
Copy the full SHA 4cdd51cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c120416 - Browse repository at this point
Copy the full SHA c120416View commit details -
Remove unnecessary loop from
ReadDecoder.decode_next
.Before this commit `fn decode_next` would `loop` to skip `Decoded::Nothing` events. This is unnecessary, because all the callers of `decode_next` already account for `Decoded::Nothing` (explicitly or implicitly via a wildcard).
Configuration menu - View commit details
-
Copy full SHA for 8f3de8a - Browse repository at this point
Copy the full SHA 8f3de8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b93ce4 - Browse repository at this point
Copy the full SHA 6b93ce4View commit details
Commits on Oct 10, 2024
-
Add separate
read_decoder.rs
module to enforce encapsulation.This commit helps to keep some aspects of `ReadDecoder` private (e.g. its fields, `decode_next` methods, etc.). This commit also means that `mod.rs` no longer directly depends on `Decoded` nor `StreamingDecoder`.
Configuration menu - View commit details
-
Copy full SHA for 2fb4b8e - Browse repository at this point
Copy the full SHA 2fb4b8eView commit details
Commits on Oct 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ae2dca9 - Browse repository at this point
Copy the full SHA ae2dca9View commit details