-
Notifications
You must be signed in to change notification settings - Fork 252
Remove the ability to use SliceReader with raw bytes #436
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
Conversation
This commit only moves code without significant changes (the only changes is: - corrected imports - add imports to the doc comments which have become inaccessible )
Main code moved from `read_namespaced_event_into` to `resolve_namespaced_event_inner`
This also changes the test cases in the `reader::test::check` macro to allow for reader-specific tests.
Waiting on #425 Next: Decoding into an internal buffer, then parsing the decoded data After: Evaluate whether user-provided buffers are still useful once we already have one internally anyway - if the benefit is minimal or nonexistent the API can be collapsed back into borrowing-based APIs which would allow us to deduplicate a bunch of code again. After: Swap the internals of Event, Attribute, etc. and remove the decoding functionality and wrappers |
Reader::from_reader_internal(BufferedReader(bytes)) | ||
} | ||
|
||
#[cfg(feature = "encoding")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving these because it doesn't make sense to check these for both when SliceReader
can't work with encoded bytes.
Codecov Report
@@ Coverage Diff @@
## master #436 +/- ##
==========================================
+ Coverage 49.51% 52.04% +2.53%
==========================================
Files 22 26 +4
Lines 13847 13453 -394
==========================================
+ Hits 6856 7002 +146
+ Misses 6991 6451 -540
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
In the near future, decoding will be performed automatically as the input is read. If the input has an unknown encoding, it must be decoded first, necessitating a buffer. Therefore only the buffered implementation can be used for `Reader::from_bytes()` If the encoding of the bytes is known up-front, you can decode them up-front and subsequently use `Reader::from_str()` if desired.
In the near future, decoding will be performed automatically as the input is read. If the input has an unknown encoding, it must be decoded first, necessitating a buffer. Therefore only the buffered implementation can be used for
Reader::from_bytes()
If the encoding of the bytes is known up-front, you can decode them up-front and subsequently use
Reader::from_str()
for borrowing behavior if desired.Made some utilities such as
detect_encoding()
,decode()
, anddecode_with_bom_removal()
available as standalone functions so that they can be used on user-provided data.