Skip to content

docs(header): correct HeaderMap max capacity and clarify reserve panic - #865

Open
ChrisJr404 wants to merge 1 commit into
hyperium:masterfrom
ChrisJr404:docs-headermap-max-capacity
Open

docs(header): correct HeaderMap max capacity and clarify reserve panic#865
ChrisJr404 wants to merge 1 commit into
hyperium:masterfrom
ChrisJr404:docs-headermap-max-capacity

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #603.

The # Limitations section said a HeaderMap can hold 32,768 entries, but inserts actually start failing at 24,576 (that is usable_capacity(MAX_SIZE)), which is the number the original reporter hit. I corrected the count and pointed the section at the fallible try_insert / try_append / try_reserve methods so there is a clear way to stay under the limit without panicking.

I also reworded the reserve panic note. It referenced the private MAX_SIZE constant, so it now points at the type docs and try_reserve instead.

Docs only, no behavior change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Undocumented capacity limit for HeaderMap

1 participant