Skip to content

Documentation of headerMap should hint from_static for construct header value #2714

Open
@Stargateur

Description

@Stargateur

The documentation of HeaderMap specially the Exemples section advice to do "example.com".parse().unwrap(), following #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: documentation.E-easyEffort: easy. A task that would be a great starting point for a new contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions