Skip to content

Decoding of set_of and sequence_of suppressing decode error in child elements? #205

Answered by XAMPPRocky
Arnix asked this question in Q&A
Discussion options

You must be logged in to vote

I am more than happy to submit a PR if my findings are correct, otherwise I will learn something new today

Thank you for your question, your findings are correct, however I think I want to have a different solution. Instead of the current loop situation, I think what I would prefer the solution to be is that we return the Option<usize> inside the closure, representing the length if present, and then the implementations can decode a explicit number of times, or continously until it hits the length marker. This would be both more performant, and allow us to support types like fixed arrays.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Arnix
Comment options

Answer selected by Arnix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants