hyperium / hyperium/hyper

Documentation of headerMap should hint from_static for construct header value

Open
#2,714 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs E-easy
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

The documentation of HeaderMap specially the Exemples section advice to do "example.com".parse().unwrap(), following https://github.com/hyperium/hyper/issues/2713 I suggest the doc should replace the .parse().unwrap() by using HeaderValue::from_static("example.com") that is much better. Or at least mention both until http release a version that require Rust 1.57 since const_panic are stable

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HeaderMap documentation's Examples section on docs.rs and review the current header-value construction example. Update the documentation to recommend HeaderValue::from_static("example.com"), or mention it alongside the existing parse example, and confirm the rendered example reflects the chosen guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.