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

Refactor media type internals #310

Merged
merged 3 commits into from
Jan 15, 2021
Merged

Conversation

yoshuawuyts
Copy link
Member

This dedupes some internal logic of our media types, and refactors them to use Cow. This also moves utf-8 detection from a nested enum to a flag. Overall this simplifies the internals of our media types without any external API changes.

I was trying to address http-rs/tide#27 (comment), but this is still blocked on the stdlib. However it seems that the only change we need to make now is to add StructuralEq to Vec and Cow so that they work in const contexts. Which should be slightly more feasible.

@yoshuawuyts
Copy link
Member Author

This has been in review for a good while now. This is just a refactor and doesn't add any new API surface, so going to go ahead and merge this.

@yoshuawuyts yoshuawuyts merged commit b58b360 into main Jan 15, 2021
@yoshuawuyts yoshuawuyts deleted the refactor-media-type-internals branch January 15, 2021 17:17
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.

1 participant