Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
21
third-party/vendor/data-url/README.md
vendored
Normal file
21
third-party/vendor/data-url/README.md
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# data-url
|
||||
|
||||
[](https://crates.io/crates/data-url)
|
||||
[](https://docs.rs/data-url/)
|
||||
|
||||
Processing of `data:` URLs in Rust according to the Fetch Standard:
|
||||
<https://fetch.spec.whatwg.org/#data-urls>
|
||||
but starting from a string rather than a parsed URL to avoid extra copies.
|
||||
|
||||
```rust
|
||||
use data_url::{DataUrl, mime};
|
||||
|
||||
let url = DataUrl::process("data:,Hello%20World!").unwrap();
|
||||
let (body, fragment) = url.decode_to_vec().unwrap();
|
||||
|
||||
assert_eq!(url.mime_type().type_, "text");
|
||||
assert_eq!(url.mime_type().subtype, "plain");
|
||||
assert_eq!(url.mime_type().get_parameter("charset"), Some("US-ASCII"));
|
||||
assert_eq!(body, b"Hello World!");
|
||||
assert!(fragment.is_none());
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue