Don't require the serde feature of url

Ends up meaning that in full crate compiles that `url` doesn't wait for
`serde` to finish, which in turn enables crates like `git2` to start
sooner!
This commit is contained in:
Alex Crichton 2019-09-17 12:47:31 -07:00
parent 35c55a9320
commit 2f79b202ee
2 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ tar = { version = "0.4.18", default-features = false }
tempfile = "3.0"
termcolor = "1.0"
toml = "0.5.3"
url = { version = "2.0", features = ['serde'] }
url = "2.0"
walkdir = "2.2"
clap = "2.31.2"
unicode-width = "0.1.5"

View file

@ -7,7 +7,6 @@ use semver::ReqParseError;
use semver::VersionReq;
use serde::ser;
use serde::Serialize;
use url::Url;
use crate::core::interning::InternedString;
use crate::core::{PackageId, SourceId, Summary};
@ -69,7 +68,7 @@ struct SerializedDependency<'a> {
target: Option<&'a Platform>,
/// The registry URL this dependency is from.
/// If None, then it comes from the default registry (crates.io).
registry: Option<Url>,
registry: Option<&'a str>,
}
impl ser::Serialize for Dependency {
@ -77,6 +76,7 @@ impl ser::Serialize for Dependency {
where
S: ser::Serializer,
{
let registry_id = self.registry_id();
SerializedDependency {
name: &*self.package_name(),
source: self.source_id(),
@ -87,7 +87,7 @@ impl ser::Serialize for Dependency {
features: self.features(),
target: self.platform(),
rename: self.explicit_name_in_toml().map(|s| s.as_str()),
registry: self.registry_id().map(|sid| sid.url().clone()),
registry: registry_id.as_ref().map(|sid| sid.url().as_str()),
}
.serialize(s)
}