url2

Crates.iourl2
lib.rsurl2
version0.0.6
sourcesrc
created_at2019-11-01 22:41:11.186455
updated_at2020-09-30 20:05:49.456158
descriptionergonomic wrapper around the popular url crate
homepage
repositoryhttps://github.com/neonphog/url2
max_upload_size
id177450
size31,788
David Braden (neonphog)

documentation

https://docs.rs/url2

README

Crates.io Crates.io

url2

Url2: Ergonomic wrapper around the popular url crate

Example

#[macro_use]
extern crate url2;

fn main() {
    let mut url = url2!("https://{}/", "example.com");
    url.query_unique()
        .set_pair("hello", "world")
        .set_pair("foo", "bar");

    assert!(url.query_unique_contains_key("hello"));
    assert_eq!("bar", url.query_unique_get("foo").unwrap());

    url.query_unique().remove("foo");

    assert_eq!(
        "https://example.com/?hello=world",
        url.as_str(),
    )
}
Commit count: 17

cargo fmt