nats-io/nats.rs

Allow construction of HeaderValue from String

nazar-pc opened this issue · 3 comments

Proposed change

If there is already allocated String with valid contents, it should be possible to create HeaderValue without unnecessary re-allocation going through &str.

Use case

To improve efficiency

Contribution

No response

Funnily enough, FromStr checks for new lines in HeaderValue and From<&str> doesn't. Is that a bug?

Funnily enough, FromStr checks for new lines in HeaderValue and From<&str> doesn't. Is that a bug?

🤷‍♂️ nats-io/nats-architecture-and-design#236

Hey!
I will have a run over those validation next week to make them consistent and not affecting perf.
HeaderValue from String is ok to add.