sonos / dinghy

Easier cross-compilation for phones and single boards computers
Other
367 stars 44 forks source link

use crate url 2.0.0 #97

Closed MarcTreySonos closed 4 years ago

MarcTreySonos commented 4 years ago

there is a regression in the latest version of the crate url version 2.1.1

the following code when invoked with an url whose scheme is ssh will return an error:

url.set_scheme("https").unwrap();

ref : https://github.com/rust-lang/cargo/blob/0.41.0/src/cargo/util/canonical_url.rs#L42

here is a simple test case to reproduce the issue :

extern crate url;
use url::Url;

fn main() {
    let mut url = Url::parse("ssh://example.net").unwrap();
    let result = url.set_scheme("https");
    assert_eq!(url.as_str(), "https://example.net/");
    assert!(result.is_ok());
}

it will work with :

cargo update --package url --precise 2.0.0

it will fail with:

cargo update --package url --precise 2.1.1

ref : https://github.com/servo/rust-url/blob/v2.1.1/src/lib.rs#L1987

MarcTreySonos commented 4 years ago

@kali latest url is back into master : https://github.com/snipsco/dinghy/blob/master/Cargo.lock#L584