Skip to content

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.

2 participants