This repository was archived by the owner on Aug 15, 2025. It is now read-only.
[Breaking change] Made all decode_from_slice also return the number of bytes read#445
Merged
VictorKoenders merged 2 commits intotrunkfrom Dec 11, 2021
Merged
Conversation
d13d7f8 to
2cfe21d
Compare
Codecov Report
@@ Coverage Diff @@
## trunk #445 +/- ##
==========================================
+ Coverage 62.87% 63.12% +0.24%
==========================================
Files 46 46
Lines 3456 3479 +23
==========================================
+ Hits 2173 2196 +23
Misses 1283 1283
Continue to review full report at Codecov.
|
ghost
approved these changes
Dec 11, 2021
ghost
left a comment
There was a problem hiding this comment.
I don't really like returning the tuple, but the only alternative would be to make the decode_from_slice function take a mutable reference, which is more restrictive than it need be.
7220034 to
8fca53f
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently there is no way to know how many bytes are read when decoding from a slice. This will make it harder to read multiple entries from a blob without encoding the length. This PR makes all
decode_from_slicefunctions return the amount of bytes read.This is a breaking change, but we're still on alpha so this should be okay.
Also fixes some of the new clippy warnings. This will conflict with #443 but we'll fix that when we get there