Crates.io | unrestrictive-url |
lib.rs | unrestrictive-url |
version | 0.1.0 |
source | src |
created_at | 2021-03-07 13:24:40.893752 |
updated_at | 2021-03-17 11:25:04.728677 |
description | A library for parsing and freely modifying URLs |
homepage | |
repository | https://github.com/SirWindfield/url-rs |
max_upload_size | |
id | 365245 |
size | 21,751 |
A lightweight wrapper around url to allow for free URL modification.
The url
crate strictly follows the WHATWG standard which means that some operations (like changing the protocol from https
to whatever
) are strictly forbidden.
This crate is a lightweight wrapper around the url
crate. It uses url
to parse a URL but allows for free modification afterwards. UnrestrictiveUrl
s implement std::fmt::Display
.
use unrestrictive_url::{Url, UnrestrictiveUrl};
let url = Url::parse("https://github.com").unwrap();
let mut url = UnrestrictiveUrl::from(&url);
url.scheme = Some("jojo");
assert_eq!("jojo://github.com/", url.to_string());