Skip to content

Docs: Clarify the HeaderMap documentaion #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

Sol-Ell
Copy link
Contributor

@Sol-Ell Sol-Ell commented Jul 14, 2025

  • Add a brief description of HeaderMap type in the header module.
  • Improve documentation of the HeaderMap type.

Note: Changing the iteration order of a HeaderMap iterator whose order is unspecified is considered a minor breaking change.

Fixes: #771

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this is a pretty nice improvement, but I had two points to change that I left inline.

@@ -14,11 +14,48 @@ use super::HeaderValue;
pub use self::as_header_name::AsHeaderName;
pub use self::into_header_name::IntoHeaderName;

/// A set of HTTP headers
/// The `HeaderMap` type is a specialized
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep a vert short sentence to start helps when the type is listed on a module page, such as: https://docs.rs/http/latest/http/header/index.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean prefer an even shorter sentence, since there isn't much space. If you look at the page I linked, and scroll down to the heading "Structs", there's a list with a tiny description. Maybe something like:

A multimap container of header names and values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback. Now, the shortened introductory paragraph consists of only 51 characters.

@Sol-Ell Sol-Ell force-pushed the clarify-header-map-doc branch from d29e1a5 to d3cc1c2 Compare July 15, 2025 06:30
@Sol-Ell Sol-Ell requested a review from seanmonstar July 15, 2025 09:26
@Sol-Ell Sol-Ell force-pushed the clarify-header-map-doc branch from d3cc1c2 to e047888 Compare July 15, 2025 17:44
@seanmonstar seanmonstar merged commit b531947 into hyperium:master Jul 15, 2025
10 checks passed
@Sol-Ell Sol-Ell deleted the clarify-header-map-doc branch July 25, 2025 19:05
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.

Clarify and refine header module documentation
2 participants