Should Map::{iter[_mut], keys, values[_mut]} guarantee the same iteration order?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 670
- PR merge metrics
- No merged PRs in 30d
Description
.keys() and .values() having the same iteration order is something that is guaranteed by both BTreeMap (iteration order is always key order) and IndexMap (iteration order is always "the order", determined by insertion sequence and any calls to .sort_by(). Is this something that serde_json could / should guarantee as well?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the serde_json Map API, especially iter, keys, values, iter_mut, and values_mut, and compare the ordering behavior described for BTreeMap and IndexMap. No source file or test is named; done requires a maintainer decision on whether matching iteration order should be guaranteed and the corresponding behavior or documentation to reflect that decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100