[go: up one dir, main page]

url2 0.0.6

ergonomic wrapper around the popular url crate
Documentation
#[macro_use]
extern crate url2;

#[test]
fn it_can_try_parse_macro() {
    assert_eq!(
        "test://bob/?a=42",
        &try_url2!("{}://{}/?a={}", "test", "bob", 42)
            .unwrap()
            .to_string(),
    );
    // with trailing comma
    assert_eq!(
        "test://bob/?a=42",
        &try_url2!("{}://{}/?a={}", "test", "bob", 42,)
            .unwrap()
            .to_string(),
    );
}

#[test]
fn it_can_parse_macro() {
    assert_eq!(
        "test://bob/?a=42",
        &url2!("{}://{}/?a={}", "test", "bob", 42).to_string(),
    );
    // with trailing comma
    assert_eq!(
        "test://bob/?a=42",
        &url2!("{}://{}/?a={}", "test", "bob", 42,).to_string(),
    );
}