Skip to content

Commit 2f79b20

Browse files
committed
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!
1 parent 35c55a9 commit 2f79b20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ tar = { version = "0.4.18", default-features = false }
6161
tempfile = "3.0"
6262
termcolor = "1.0"
6363
toml = "0.5.3"
64-
url = { version = "2.0", features = ['serde'] }
64+
url = "2.0"
6565
walkdir = "2.2"
6666
clap = "2.31.2"
6767
unicode-width = "0.1.5"

src/cargo/core/dependency.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use semver::ReqParseError;
77
use semver::VersionReq;
88
use serde::ser;
99
use serde::Serialize;
10-
use url::Url;
1110

1211
use crate::core::interning::InternedString;
1312
use crate::core::{PackageId, SourceId, Summary};
@@ -69,14 +68,15 @@ struct SerializedDependency<'a> {
6968
target: Option<&'a Platform>,
7069
/// The registry URL this dependency is from.
7170
/// If None, then it comes from the default registry (crates.io).
72-
registry: Option<Url>,
71+
registry: Option<&'a str>,
7372
}
7473

7574
impl ser::Serialize for Dependency {
7675
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
7776
where
7877
S: ser::Serializer,
7978
{
79+
let registry_id = self.registry_id();
8080
SerializedDependency {
8181
name: &*self.package_name(),
8282
source: self.source_id(),
@@ -87,7 +87,7 @@ impl ser::Serialize for Dependency {
8787
features: self.features(),
8888
target: self.platform(),
8989
rename: self.explicit_name_in_toml().map(|s| s.as_str()),
90-
registry: self.registry_id().map(|sid| sid.url().clone()),
90+
registry: registry_id.as_ref().map(|sid| sid.url().as_str()),
9191
}
9292
.serialize(s)
9393
}

0 commit comments

Comments
 (0)