hyper
hyper copied to clipboard
Documentation of headerMap should hint from_static for construct header value
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
Or at least mention both until http release a version that require Rust 1.57 since
const_panicare stable
FWIW from_static doesn't depend on const_panic https://docs.rs/http/latest/src/http/header/value.rs.html#87
I was guessing the reason it was not the case it's because the error message is confusing, const_panic should allow a more clear message.