Skip to content

Commit

Permalink
Auto merge of #9550 - hi-rustin:rustin-patch-feat, r=ehuss
Browse files Browse the repository at this point in the history
add default_run to SerializedPackage

close #9497
  • Loading branch information
bors committed Jun 9, 2021
2 parents 2544bd3 + 1abc4f2 commit 66686fd
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub struct SerializedPackage {
links: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
metabuild: Option<Vec<String>>,
default_run: Option<String>,
}

impl Package {
Expand Down Expand Up @@ -267,6 +268,7 @@ impl Package {
links: self.manifest().links().map(|s| s.to_owned()),
metabuild: self.manifest().metabuild().cloned(),
publish: self.publish().as_ref().cloned(),
default_run: self.manifest().default_run().map(|s| s.to_owned()),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/doc/man/cargo-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ The output has the following format:
"categories": [
"command-line-utilities"
],
/* Optional string that is the default binary picked by cargo run. */
"default_run": null,
/* Array of keywords from the manifest. */
"keywords": [
"cli"
Expand Down
2 changes: 2 additions & 0 deletions src/doc/man/generated_txt/cargo-metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ OUTPUT FORMAT
"categories": [
"command-line-utilities"
],
/* Optional string that is the default binary picked by cargo run. */
"default_run": null,
/* Array of keywords from the manifest. */
"keywords": [
"cli"
Expand Down
2 changes: 2 additions & 0 deletions src/doc/src/commands/cargo-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ The output has the following format:
"categories": [
"command-line-utilities"
],
/* Optional string that is the default binary picked by cargo run. */
"default_run": null,
/* Array of keywords from the manifest. */
"keywords": [
"cli"
Expand Down
2 changes: 2 additions & 0 deletions src/etc/man/cargo-metadata.1
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ The output has the following format:
"categories": [
"command\-line\-utilities"
],
/* Optional string that is the default binary picked by cargo run. */
"default_run": null,
/* Array of keywords from the manifest. */
"keywords": [
"cli"
Expand Down
9 changes: 9 additions & 0 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -885,6 +886,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand All @@ -909,6 +911,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand All @@ -933,6 +936,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -982,6 +986,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -1019,6 +1024,7 @@ fn alt_reg_metadata() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -1115,6 +1121,7 @@ fn unknown_registry() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand All @@ -1139,6 +1146,7 @@ fn unknown_registry() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -1176,6 +1184,7 @@ fn unknown_registry() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/features_namespaced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ fn json_exposed() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3081,6 +3081,7 @@ fn metadata_master_consistency() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -3118,6 +3119,7 @@ fn metadata_master_consistency() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down
Loading

0 comments on commit 66686fd

Please sign in to comment.