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

Introduce get and get_all semantics to HeaderMap #1071

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

n1ghtmare
Copy link
Collaborator

Closes #925

Copy link
Collaborator

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -46,7 +46,7 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, PartialEq, Eq, Debug, Default, Deserialize, Serialize)]
pub struct HeaderMap {
inner: HashMap<HeaderName, HeaderValue>,
inner: HashMap<HeaderName, Vec<HeaderValue>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caspervonb considering that we are sending 99% cases header with one value, maybe it's worth making this VecOrString enum to save some allocations?

Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jarema Jarema merged commit ff7e1dd into nats-io:main Aug 4, 2023
13 checks passed
@Jarema Jarema mentioned this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement get and get_all for HeaderMap
3 participants