Skip to content

Commit

Permalink
add default_run to SerializedPackage
Browse files Browse the repository at this point in the history
Delete "default_run": null,
  • Loading branch information
Rustin170506 committed Jun 7, 2021
1 parent d3bc132 commit f9a5625
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 1 deletion.
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
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
30 changes: 29 additions & 1 deletion tests/testsuite/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fn cargo_metadata_simple() {
"[email protected]"
],
"categories": [],
"default_run": null,
"name": "foo",
"version": "0.5.0",
"id": "foo[..]",
Expand Down Expand Up @@ -119,6 +120,7 @@ crate-type = ["lib", "staticlib"]
{
"authors": [],
"categories": [],
"default_run": null,
"name": "foo",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -206,6 +208,7 @@ optional_feat = []
{
"authors": [],
"categories": [],
"default_run": null,
"name": "foo",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -309,6 +312,7 @@ fn cargo_metadata_with_deps_and_version() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [
{
"features": [],
Expand Down Expand Up @@ -361,6 +365,7 @@ fn cargo_metadata_with_deps_and_version() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -400,6 +405,7 @@ fn cargo_metadata_with_deps_and_version() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [
{
"features": [],
Expand Down Expand Up @@ -464,6 +470,7 @@ fn cargo_metadata_with_deps_and_version() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -605,6 +612,7 @@ name = "ex"
{
"authors": [],
"categories": [],
"default_run": null,
"name": "foo",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -698,6 +706,7 @@ crate-type = ["rlib", "dylib"]
{
"authors": [],
"categories": [],
"default_run": null,
"name": "foo",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -798,6 +807,7 @@ fn workspace_metadata() {
"[email protected]"
],
"categories": [],
"default_run": null,
"name": "bar",
"version": "0.5.0",
"id": "bar[..]",
Expand Down Expand Up @@ -835,6 +845,7 @@ fn workspace_metadata() {
"[email protected]"
],
"categories": [],
"default_run": null,
"name": "baz",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -927,6 +938,7 @@ fn workspace_metadata_no_deps() {
"[email protected]"
],
"categories": [],
"default_run": null,
"name": "bar",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -964,6 +976,7 @@ fn workspace_metadata_no_deps() {
"[email protected]"
],
"categories": [],
"default_run": null,
"name": "baz",
"readme": null,
"repository": null,
Expand Down Expand Up @@ -1031,6 +1044,7 @@ const MANIFEST_OUTPUT: &str = r#"
"[email protected]"
],
"categories": [],
"default_run": null,
"name":"foo",
"version":"0.5.0",
"id":"foo[..]0.5.0[..](path+file://[..]/foo)",
Expand Down Expand Up @@ -1216,6 +1230,7 @@ fn package_metadata() {
{
"authors": ["[email protected]"],
"categories": ["database"],
"default_run": null,
"name": "foo",
"readme": "README.md",
"repository": "https://github.com/rust-lang/cargo",
Expand Down Expand Up @@ -1293,6 +1308,7 @@ fn package_publish() {
{
"authors": ["[email protected]"],
"categories": ["database"],
"default_run": null,
"name": "foo",
"readme": "README.md",
"repository": "https://github.com/rust-lang/cargo",
Expand Down Expand Up @@ -1367,6 +1383,7 @@ fn cargo_metadata_path_to_cargo_toml_project() {
"[email protected]"
],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -1453,6 +1470,7 @@ fn package_edition_2018() {
"[email protected]"
],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2018",
Expand Down Expand Up @@ -1543,6 +1561,7 @@ fn target_edition_2018() {
"[email protected]"
],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -1648,6 +1667,7 @@ fn rename_dependency() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -1687,6 +1707,7 @@ fn rename_dependency() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -1726,6 +1747,7 @@ fn rename_dependency() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [
{
"features": [],
Expand Down Expand Up @@ -1871,6 +1893,7 @@ fn metadata_links() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"edition": "2015",
Expand Down Expand Up @@ -1975,7 +1998,6 @@ fn deps_with_bin_only() {
"id": "foo 0.1.0 ([..])",
"license": null,
"license_file": null,
"description": null,
"source": null,
"dependencies": [
{
Expand Down Expand Up @@ -2014,6 +2036,7 @@ fn deps_with_bin_only() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -2117,6 +2140,7 @@ fn filter_platform() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -2159,6 +2183,7 @@ fn filter_platform() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -2201,6 +2226,7 @@ fn filter_platform() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -2243,6 +2269,7 @@ fn filter_platform() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down Expand Up @@ -2348,6 +2375,7 @@ fn filter_platform() {
"publish": null,
"authors": [],
"categories": [],
"default_run": null,
"keywords": [],
"readme": null,
"repository": null,
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/read_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fn manifest_output(readme_value: &str) -> String {
"[email protected]"
],
"categories": [],
"default_run": null,
"name":"foo",
"readme": {},
"homepage": null,
Expand Down
2 changes: 2 additions & 0 deletions tests/testsuite/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ fn update_precise_first_run() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [
{
"features": [],
Expand Down Expand Up @@ -485,6 +486,7 @@ fn update_precise_first_run() {
{
"authors": [],
"categories": [],
"default_run": null,
"dependencies": [],
"description": null,
"documentation": null,
Expand Down

0 comments on commit f9a5625

Please sign in to comment.