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

mime: add as_str() to ParamName and ParamValue #188

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

Fishrock123
Copy link
Member

@Fishrock123 Fishrock123 commented Jun 25, 2020

Previously, there was no way to actually get the string values.

This (or something like it) is blocking using http_types::mime in Surf.

Noticed from Surf: https://github.com/http-rs/surf/blob/be10806bb9731c7a1d0f3d36296a1cc61267b775/src/response.rs#L164

Previously, there was no way to actually get the string values.
@Fishrock123 Fishrock123 requested review from yoshuawuyts and removed request for yoshuawuyts June 25, 2020 02:06
@Fishrock123
Copy link
Member Author

The issue I ran into was ultimately solved by .map(|v| v.to_string()).as_deref(), but I feel like this would be better? i.e. map(|v| v.as_str())?

Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

💯

@yoshuawuyts yoshuawuyts merged commit a749a59 into http-rs:master Jun 27, 2020
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.

2 participants