servo / rust-url

URL parser for Rust
https://docs.rs/url/
Apache License 2.0
1.3k stars 325 forks source link

Can data-url interoperate better with the mime crate? #567

Open pshaughn opened 4 years ago

pshaughn commented 4 years ago

data-url has a Mime class distinct from the one in https://crates.io/crates/mime and it's looking like using data-url in servo as a replacement for https://crates.io/crates/base64 might mean redundantly parsing the mime type into both classes.

Could data-url:

  1. migrate to that mime class, or
  2. offer a codepath that just skips the mime-type parsing entirely, for use by client code that is already parsing its own mime type?
SimonSapin commented 4 years ago

https://crates.io/crates/mime has a parser, but it’s not the same parsing algorithm: https://github.com/hyperium/mime/issues/78