Skip to content
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

Make HeaderValue use Bytes internally #1078

Open
caspervonb opened this issue Aug 4, 2023 · 0 comments · May be fixed by #1085
Open

Make HeaderValue use Bytes internally #1078

caspervonb opened this issue Aug 4, 2023 · 0 comments · May be fixed by #1085
Assignees
Labels
enhancement Enhancement to existing functionality

Comments

@caspervonb
Copy link
Collaborator

Use case

HeaderValue may be well known within a program, if we use bytes to represent header field values we can make use of from_static to allocate static header values.

Proposed change

Introduce from_static on HeaderValue and make the internal representation Bytes.

let put = HeaderName::from_static("PUT");
let delete = HeaderName::from_static("DELETE");

Who benefits from the change(s)?

Everyone sending static payloads in headers

Alternative Approaches

No response

@caspervonb caspervonb added the enhancement Enhancement to existing functionality label Aug 4, 2023
@caspervonb caspervonb self-assigned this Aug 4, 2023
@caspervonb caspervonb linked a pull request Oct 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant