HeaderMap::try_with_capacity can panic when capacity is large
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 378
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
In PR #617, try_methods are provided to prevent the panic
In PR #628, capacity overflow is resolve but introduce panic
Just like implementation in hashbrown, maybe to_raw_capacity can return Option<usize> too.
Contributor guide
No contributing guide indexed for this repository
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 HeaderMap::try_with_capacity and trace its capacity handling through to_raw_capacity. Compare the referenced hashbrown implementation and the changes from PRs #617 and #628; done means a large capacity no longer causes a panic while the try method reports failure appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100