Skip to content

Commit f9a5625

Browse files
committed
add default_run to SerializedPackage
Delete "default_run": null,
1 parent d3bc132 commit f9a5625

File tree

7 files changed

+46
-1
lines changed

7 files changed

+46
-1
lines changed

src/cargo/core/package.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ pub struct SerializedPackage {
102102
links: Option<String>,
103103
#[serde(skip_serializing_if = "Option::is_none")]
104104
metabuild: Option<Vec<String>>,
105+
default_run: Option<String>,
105106
}
106107

107108
impl Package {
@@ -267,6 +268,7 @@ impl Package {
267268
links: self.manifest().links().map(|s| s.to_owned()),
268269
metabuild: self.manifest().metabuild().cloned(),
269270
publish: self.publish().as_ref().cloned(),
271+
default_run: self.manifest().default_run().map(|s| s.to_owned()),
270272
}
271273
}
272274
}

tests/testsuite/alt_registry.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,7 @@ fn alt_reg_metadata() {
829829
"publish": null,
830830
"authors": [],
831831
"categories": [],
832+
"default_run": null,
832833
"keywords": [],
833834
"readme": null,
834835
"repository": null,
@@ -885,6 +886,7 @@ fn alt_reg_metadata() {
885886
"publish": null,
886887
"authors": [],
887888
"categories": [],
889+
"default_run": null,
888890
"keywords": [],
889891
"readme": null,
890892
"repository": null,
@@ -909,6 +911,7 @@ fn alt_reg_metadata() {
909911
"publish": null,
910912
"authors": [],
911913
"categories": [],
914+
"default_run": null,
912915
"keywords": [],
913916
"readme": null,
914917
"repository": null,
@@ -933,6 +936,7 @@ fn alt_reg_metadata() {
933936
"publish": null,
934937
"authors": [],
935938
"categories": [],
939+
"default_run": null,
936940
"keywords": [],
937941
"readme": null,
938942
"repository": null,
@@ -982,6 +986,7 @@ fn alt_reg_metadata() {
982986
"publish": null,
983987
"authors": [],
984988
"categories": [],
989+
"default_run": null,
985990
"keywords": [],
986991
"readme": null,
987992
"repository": null,
@@ -1019,6 +1024,7 @@ fn alt_reg_metadata() {
10191024
"publish": null,
10201025
"authors": [],
10211026
"categories": [],
1027+
"default_run": null,
10221028
"keywords": [],
10231029
"readme": null,
10241030
"repository": null,
@@ -1115,6 +1121,7 @@ fn unknown_registry() {
11151121
"publish": null,
11161122
"authors": [],
11171123
"categories": [],
1124+
"default_run": null,
11181125
"keywords": [],
11191126
"readme": null,
11201127
"repository": null,
@@ -1139,6 +1146,7 @@ fn unknown_registry() {
11391146
"publish": null,
11401147
"authors": [],
11411148
"categories": [],
1149+
"default_run": null,
11421150
"keywords": [],
11431151
"readme": null,
11441152
"repository": null,
@@ -1176,6 +1184,7 @@ fn unknown_registry() {
11761184
"publish": null,
11771185
"authors": [],
11781186
"categories": [],
1187+
"default_run": null,
11791188
"keywords": [],
11801189
"readme": null,
11811190
"repository": null,

tests/testsuite/features_namespaced.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ fn json_exposed() {
766766
"publish": null,
767767
"authors": [],
768768
"categories": [],
769+
"default_run": null,
769770
"keywords": [],
770771
"readme": null,
771772
"repository": null,

tests/testsuite/git.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,6 +3081,7 @@ fn metadata_master_consistency() {
30813081
"publish": null,
30823082
"authors": [],
30833083
"categories": [],
3084+
"default_run": null,
30843085
"keywords": [],
30853086
"readme": null,
30863087
"repository": null,
@@ -3118,6 +3119,7 @@ fn metadata_master_consistency() {
31183119
"publish": null,
31193120
"authors": [],
31203121
"categories": [],
3122+
"default_run": null,
31213123
"keywords": [],
31223124
"readme": null,
31233125
"repository": null,

tests/testsuite/metadata.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn cargo_metadata_simple() {
2222
"wycats@example.com"
2323
],
2424
"categories": [],
25+
"default_run": null,
2526
"name": "foo",
2627
"version": "0.5.0",
2728
"id": "foo[..]",
@@ -119,6 +120,7 @@ crate-type = ["lib", "staticlib"]
119120
{
120121
"authors": [],
121122
"categories": [],
123+
"default_run": null,
122124
"name": "foo",
123125
"readme": null,
124126
"repository": null,
@@ -206,6 +208,7 @@ optional_feat = []
206208
{
207209
"authors": [],
208210
"categories": [],
211+
"default_run": null,
209212
"name": "foo",
210213
"readme": null,
211214
"repository": null,
@@ -309,6 +312,7 @@ fn cargo_metadata_with_deps_and_version() {
309312
{
310313
"authors": [],
311314
"categories": [],
315+
"default_run": null,
312316
"dependencies": [
313317
{
314318
"features": [],
@@ -361,6 +365,7 @@ fn cargo_metadata_with_deps_and_version() {
361365
{
362366
"authors": [],
363367
"categories": [],
368+
"default_run": null,
364369
"dependencies": [],
365370
"description": null,
366371
"edition": "2015",
@@ -400,6 +405,7 @@ fn cargo_metadata_with_deps_and_version() {
400405
{
401406
"authors": [],
402407
"categories": [],
408+
"default_run": null,
403409
"dependencies": [
404410
{
405411
"features": [],
@@ -464,6 +470,7 @@ fn cargo_metadata_with_deps_and_version() {
464470
{
465471
"authors": [],
466472
"categories": [],
473+
"default_run": null,
467474
"dependencies": [],
468475
"description": null,
469476
"edition": "2015",
@@ -605,6 +612,7 @@ name = "ex"
605612
{
606613
"authors": [],
607614
"categories": [],
615+
"default_run": null,
608616
"name": "foo",
609617
"readme": null,
610618
"repository": null,
@@ -698,6 +706,7 @@ crate-type = ["rlib", "dylib"]
698706
{
699707
"authors": [],
700708
"categories": [],
709+
"default_run": null,
701710
"name": "foo",
702711
"readme": null,
703712
"repository": null,
@@ -798,6 +807,7 @@ fn workspace_metadata() {
798807
"wycats@example.com"
799808
],
800809
"categories": [],
810+
"default_run": null,
801811
"name": "bar",
802812
"version": "0.5.0",
803813
"id": "bar[..]",
@@ -835,6 +845,7 @@ fn workspace_metadata() {
835845
"wycats@example.com"
836846
],
837847
"categories": [],
848+
"default_run": null,
838849
"name": "baz",
839850
"readme": null,
840851
"repository": null,
@@ -927,6 +938,7 @@ fn workspace_metadata_no_deps() {
927938
"wycats@example.com"
928939
],
929940
"categories": [],
941+
"default_run": null,
930942
"name": "bar",
931943
"readme": null,
932944
"repository": null,
@@ -964,6 +976,7 @@ fn workspace_metadata_no_deps() {
964976
"wycats@example.com"
965977
],
966978
"categories": [],
979+
"default_run": null,
967980
"name": "baz",
968981
"readme": null,
969982
"repository": null,
@@ -1031,6 +1044,7 @@ const MANIFEST_OUTPUT: &str = r#"
10311044
"wycats@example.com"
10321045
],
10331046
"categories": [],
1047+
"default_run": null,
10341048
"name":"foo",
10351049
"version":"0.5.0",
10361050
"id":"foo[..]0.5.0[..](path+file://[..]/foo)",
@@ -1216,6 +1230,7 @@ fn package_metadata() {
12161230
{
12171231
"authors": ["wycats@example.com"],
12181232
"categories": ["database"],
1233+
"default_run": null,
12191234
"name": "foo",
12201235
"readme": "README.md",
12211236
"repository": "https://github.com/rust-lang/cargo",
@@ -1293,6 +1308,7 @@ fn package_publish() {
12931308
{
12941309
"authors": ["wycats@example.com"],
12951310
"categories": ["database"],
1311+
"default_run": null,
12961312
"name": "foo",
12971313
"readme": "README.md",
12981314
"repository": "https://github.com/rust-lang/cargo",
@@ -1367,6 +1383,7 @@ fn cargo_metadata_path_to_cargo_toml_project() {
13671383
"wycats@example.com"
13681384
],
13691385
"categories": [],
1386+
"default_run": null,
13701387
"dependencies": [],
13711388
"description": null,
13721389
"edition": "2015",
@@ -1453,6 +1470,7 @@ fn package_edition_2018() {
14531470
"wycats@example.com"
14541471
],
14551472
"categories": [],
1473+
"default_run": null,
14561474
"dependencies": [],
14571475
"description": null,
14581476
"edition": "2018",
@@ -1543,6 +1561,7 @@ fn target_edition_2018() {
15431561
"wycats@example.com"
15441562
],
15451563
"categories": [],
1564+
"default_run": null,
15461565
"dependencies": [],
15471566
"description": null,
15481567
"edition": "2015",
@@ -1648,6 +1667,7 @@ fn rename_dependency() {
16481667
{
16491668
"authors": [],
16501669
"categories": [],
1670+
"default_run": null,
16511671
"dependencies": [],
16521672
"description": null,
16531673
"edition": "2015",
@@ -1687,6 +1707,7 @@ fn rename_dependency() {
16871707
{
16881708
"authors": [],
16891709
"categories": [],
1710+
"default_run": null,
16901711
"dependencies": [],
16911712
"description": null,
16921713
"edition": "2015",
@@ -1726,6 +1747,7 @@ fn rename_dependency() {
17261747
{
17271748
"authors": [],
17281749
"categories": [],
1750+
"default_run": null,
17291751
"dependencies": [
17301752
{
17311753
"features": [],
@@ -1871,6 +1893,7 @@ fn metadata_links() {
18711893
{
18721894
"authors": [],
18731895
"categories": [],
1896+
"default_run": null,
18741897
"dependencies": [],
18751898
"description": null,
18761899
"edition": "2015",
@@ -1975,7 +1998,6 @@ fn deps_with_bin_only() {
19751998
"id": "foo 0.1.0 ([..])",
19761999
"license": null,
19772000
"license_file": null,
1978-
"description": null,
19792001
"source": null,
19802002
"dependencies": [
19812003
{
@@ -2014,6 +2036,7 @@ fn deps_with_bin_only() {
20142036
"publish": null,
20152037
"authors": [],
20162038
"categories": [],
2039+
"default_run": null,
20172040
"keywords": [],
20182041
"readme": null,
20192042
"repository": null,
@@ -2117,6 +2140,7 @@ fn filter_platform() {
21172140
"publish": null,
21182141
"authors": [],
21192142
"categories": [],
2143+
"default_run": null,
21202144
"keywords": [],
21212145
"readme": null,
21222146
"repository": null,
@@ -2159,6 +2183,7 @@ fn filter_platform() {
21592183
"publish": null,
21602184
"authors": [],
21612185
"categories": [],
2186+
"default_run": null,
21622187
"keywords": [],
21632188
"readme": null,
21642189
"repository": null,
@@ -2201,6 +2226,7 @@ fn filter_platform() {
22012226
"publish": null,
22022227
"authors": [],
22032228
"categories": [],
2229+
"default_run": null,
22042230
"keywords": [],
22052231
"readme": null,
22062232
"repository": null,
@@ -2243,6 +2269,7 @@ fn filter_platform() {
22432269
"publish": null,
22442270
"authors": [],
22452271
"categories": [],
2272+
"default_run": null,
22462273
"keywords": [],
22472274
"readme": null,
22482275
"repository": null,
@@ -2348,6 +2375,7 @@ fn filter_platform() {
23482375
"publish": null,
23492376
"authors": [],
23502377
"categories": [],
2378+
"default_run": null,
23512379
"keywords": [],
23522380
"readme": null,
23532381
"repository": null,

tests/testsuite/read_manifest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn manifest_output(readme_value: &str) -> String {
1010
"wycats@example.com"
1111
],
1212
"categories": [],
13+
"default_run": null,
1314
"name":"foo",
1415
"readme": {},
1516
"homepage": null,

tests/testsuite/update.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ fn update_precise_first_run() {
433433
{
434434
"authors": [],
435435
"categories": [],
436+
"default_run": null,
436437
"dependencies": [
437438
{
438439
"features": [],
@@ -485,6 +486,7 @@ fn update_precise_first_run() {
485486
{
486487
"authors": [],
487488
"categories": [],
489+
"default_run": null,
488490
"dependencies": [],
489491
"description": null,
490492
"documentation": null,

0 commit comments

Comments
 (0)