mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Update with master changes
This commit is contained in:
parent
ae1efeedf5
commit
c097d985cc
@ -1 +1 @@
|
|||||||
Subproject commit b8d306fd2e96bafa3dbbc8da72fd787c4f77978f
|
Subproject commit bbb7848676698ec94d186e2c910ab82452d07433
|
@ -1 +1 @@
|
|||||||
Subproject commit 6e0701caa513e11f939899c4d6c258537796c0d3
|
Subproject commit 624d5398184ccd500c3ce02338006f32f380fcc9
|
@ -1,5 +1,4 @@
|
|||||||
use semver;
|
use semver;
|
||||||
use url;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fmt::{Show,Formatter};
|
use std::fmt::{Show,Formatter};
|
||||||
@ -38,7 +37,7 @@ trait ToUrl {
|
|||||||
|
|
||||||
impl<'a> ToUrl for &'a str {
|
impl<'a> ToUrl for &'a str {
|
||||||
fn to_url(self) -> Result<Url, String> {
|
fn to_url(self) -> Result<Url, String> {
|
||||||
url::from_str(self)
|
Url::parse(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ pub fn resolve<R: Registry>(deps: &[Dependency],
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use url;
|
|
||||||
use hamcrest::{assert_that, equal_to, contains};
|
use hamcrest::{assert_that, equal_to, contains};
|
||||||
|
|
||||||
use core::source::{SourceId, RegistryKind, Location, Remote};
|
use core::source::{SourceId, RegistryKind, Location, Remote};
|
||||||
@ -71,7 +70,7 @@ mod test {
|
|||||||
|
|
||||||
impl ToDep for &'static str {
|
impl ToDep for &'static str {
|
||||||
fn to_dep(self) -> Dependency {
|
fn to_dep(self) -> Dependency {
|
||||||
let url = url::from_str("http://example.com").unwrap();
|
let url = from_str("http://example.com").unwrap();
|
||||||
let source_id = SourceId::new(RegistryKind, Remote(url));
|
let source_id = SourceId::new(RegistryKind, Remote(url));
|
||||||
Dependency::parse(self, Some("1.0.0"), &source_id).unwrap()
|
Dependency::parse(self, Some("1.0.0"), &source_id).unwrap()
|
||||||
}
|
}
|
||||||
@ -107,7 +106,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn dep(name: &str) -> Dependency {
|
fn dep(name: &str) -> Dependency {
|
||||||
let url = url::from_str("http://example.com").unwrap();
|
let url = from_str("http://example.com").unwrap();
|
||||||
let source_id = SourceId::new(RegistryKind, Remote(url));
|
let source_id = SourceId::new(RegistryKind, Remote(url));
|
||||||
Dependency::parse(name, Some("1.0.0"), &source_id).unwrap()
|
Dependency::parse(name, Some("1.0.0"), &source_id).unwrap()
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fmt::{Show, Formatter};
|
use std::fmt::{Show, Formatter};
|
||||||
|
|
||||||
use url;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use core::{Summary, Package, PackageId};
|
use core::{Summary, Package, PackageId};
|
||||||
@ -82,7 +81,7 @@ impl Location {
|
|||||||
if s.starts_with("file:") {
|
if s.starts_with("file:") {
|
||||||
Ok(Local(Path::new(s.slice_from(5))))
|
Ok(Local(Path::new(s.slice_from(5))))
|
||||||
} else {
|
} else {
|
||||||
url::from_str(s).map(Remote).map_err(|e| {
|
Url::parse(s).map(Remote).map_err(|e| {
|
||||||
human(format!("invalid url `{}`: `{}", s, e))
|
human(format!("invalid url `{}`: `{}", s, e))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -146,7 +145,7 @@ impl SourceId {
|
|||||||
|
|
||||||
pub fn for_central() -> SourceId {
|
pub fn for_central() -> SourceId {
|
||||||
SourceId::new(RegistryKind,
|
SourceId::new(RegistryKind,
|
||||||
Remote(url::from_str("https://example.com").unwrap()))
|
Remote(Url::parse("https://example.com").unwrap()))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_location<'a>(&'a self) -> &'a Location {
|
pub fn get_location<'a>(&'a self) -> &'a Location {
|
||||||
|
@ -181,7 +181,6 @@ impl<'a, 'b> Source for GitSource<'a, 'b> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use url;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use core::source::Remote;
|
use core::source::Remote;
|
||||||
use super::ident;
|
use super::ident;
|
||||||
@ -227,6 +226,6 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn url(s: &str) -> Url {
|
fn url(s: &str) -> Url {
|
||||||
url::from_str(s).unwrap()
|
from_str(s).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user