unrestrictive-url

Crates.iounrestrictive-url
lib.rsunrestrictive-url
version0.1.0
sourcesrc
created_at2021-03-07 13:24:40.893752
updated_at2021-03-17 11:25:04.728677
descriptionA library for parsing and freely modifying URLs
homepage
repositoryhttps://github.com/SirWindfield/url-rs
max_upload_size
id365245
size21,751
mainrs (mainrs)

documentation

README

unrestrictive-url

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. UnrestrictiveUrls implement std::fmt::Display.

Example

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());
Commit count: 12

cargo fmt