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 https://github.com/http-rs/tide/issues/27#issuecomment-750921221, 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.
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 https://github.com/http-rs/tide/issues/27#issuecomment-750921221, but this is still blocked on the stdlib. However it seems that the only change we need to make now is to add
StructuralEq
toVec
andCow
so that they work in const contexts. Which should be slightly more feasible.