Skip to content

Commit 58bc357

Browse files
committed
Add homepage and documentation to package in cargo metadata
1 parent 75615f8 commit 58bc357

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cargo/core/package.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ struct SerializedPackage<'a> {
9696
keywords: &'a [String],
9797
readme: Option<&'a str>,
9898
repository: Option<&'a str>,
99+
homepage: Option<&'a str>,
100+
documentation: Option<&'a str>,
99101
edition: &'a str,
100102
links: Option<&'a str>,
101103
#[serde(skip_serializing_if = "Option::is_none")]
@@ -118,6 +120,8 @@ impl ser::Serialize for Package {
118120
let keywords = manmeta.keywords.as_ref();
119121
let readme = manmeta.readme.as_deref();
120122
let repository = manmeta.repository.as_deref();
123+
let homepage = manmeta.homepage.as_ref().map(String::as_ref);
124+
let documentation = manmeta.documentation.as_ref().map(String::as_ref);
121125
// Filter out metabuild targets. They are an internal implementation
122126
// detail that is probably not relevant externally. There's also not a
123127
// real path to show in `src_path`, and this avoids changing the format.
@@ -146,6 +150,8 @@ impl ser::Serialize for Package {
146150
keywords,
147151
readme,
148152
repository,
153+
homepage,
154+
documentation,
149155
edition: &self.manifest().edition().to_string(),
150156
links: self.manifest().links(),
151157
metabuild: self.manifest().metabuild(),

0 commit comments

Comments
 (0)