Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Decoder::read_seq requires infinite lookahead #68

Closed
oli-obk opened this issue Feb 27, 2015 · 1 comment
Closed

Decoder::read_seq requires infinite lookahead #68

oli-obk opened this issue Feb 27, 2015 · 1 comment

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Feb 27, 2015

Implementing Decoder for a representation that does not know the length of sequences ahead of time requires infinite lookahead, since the length needs to be known before the first element is parsed.

For example: if Json were not parsed to the Json enum as an intermediate, when a sequence is expected, the read_seq function would need to parse ahead until it finds the corresponding ].

Also, all the collection implementations in collection_impls.rs do not require the length to be known beforehand. They only use it as an optimization to reduce the number of allocations.

@alexcrichton
Copy link
Contributor

I'm going to close this now that this crate is deprecated in favor of serde. We're discontinuing feature development in rustc-serialize but will still continue to merge bug fixes if they arise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants