Skip to content

Commit 40cca80

Browse files
committed
Undoing bad formatting changes and removing redundant struct fields
1 parent 142bafb commit 40cca80

File tree

5 files changed

+38
-26
lines changed

5 files changed

+38
-26
lines changed

src/bin/cargo/commands/package.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
4343
allow_dirty: args.is_present("allow-dirty"),
4444
target: args.target(),
4545
jobs: args.jobs()?,
46-
registry: None,
4746
features: args._values_of("features"),
4847
all_features: args.is_present("all-features"),
4948
},

src/cargo/ops/cargo_package.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub struct PackageOpts<'cfg> {
2626
pub verify: bool,
2727
pub jobs: Option<u32>,
2828
pub target: Option<String>,
29-
pub registry: Option<String>,
3029
pub features: Vec<String>,
3130
pub all_features: bool,
3231
}

src/cargo/ops/registry.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
8484
allow_dirty: opts.allow_dirty,
8585
target: opts.target.clone(),
8686
jobs: opts.jobs,
87-
registry: opts.registry.clone(),
8887
features: opts.features.clone(),
8988
all_features: opts.all_features,
9089
},

tests/testsuite/package.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,6 @@ fn package_with_select_features() {
13051305
.file(
13061306
"Cargo.toml",
13071307
r#"
1308-
cargo-features = ["alternative-registries"]
1309-
13101308
[project]
13111309
name = "foo"
13121310
version = "0.0.1"
@@ -1337,8 +1335,6 @@ fn package_with_all_features() {
13371335
.file(
13381336
"Cargo.toml",
13391337
r#"
1340-
cargo-features = ["alternative-registries"]
1341-
13421338
[project]
13431339
name = "foo"
13441340
version = "0.0.1"

tests/testsuite/publish.rs

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ fn simple() {
2323
license = "MIT"
2424
description = "foo"
2525
"#,
26-
).file("src/main.rs", "fn main() {}")
26+
)
27+
.file("src/main.rs", "fn main() {}")
2728
.build();
2829

2930
p.cargo("publish --no-verify --index")
@@ -96,7 +97,8 @@ fn old_token_location() {
9697
license = "MIT"
9798
description = "foo"
9899
"#,
99-
).file("src/main.rs", "fn main() {}")
100+
)
101+
.file("src/main.rs", "fn main() {}")
100102
.build();
101103

102104
p.cargo("publish --no-verify --index")
@@ -162,7 +164,8 @@ fn simple_with_host() {
162164
license = "MIT"
163165
description = "foo"
164166
"#,
165-
).file("src/main.rs", "fn main() {}")
167+
)
168+
.file("src/main.rs", "fn main() {}")
166169
.build();
167170

168171
p.cargo("publish --no-verify --host")
@@ -237,7 +240,8 @@ fn simple_with_index_and_host() {
237240
license = "MIT"
238241
description = "foo"
239242
"#,
240-
).file("src/main.rs", "fn main() {}")
243+
)
244+
.file("src/main.rs", "fn main() {}")
241245
.build();
242246

243247
p.cargo("publish --no-verify --index")
@@ -315,7 +319,8 @@ fn git_deps() {
315319
[dependencies.foo]
316320
git = "git://path/to/nowhere"
317321
"#,
318-
).file("src/main.rs", "fn main() {}")
322+
)
323+
.file("src/main.rs", "fn main() {}")
319324
.build();
320325

321326
p.cargo("publish -v --no-verify --index")
@@ -351,7 +356,8 @@ fn path_dependency_no_version() {
351356
[dependencies.bar]
352357
path = "bar"
353358
"#,
354-
).file("src/main.rs", "fn main() {}")
359+
)
360+
.file("src/main.rs", "fn main() {}")
355361
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
356362
.file("bar/src/lib.rs", "")
357363
.build();
@@ -384,7 +390,8 @@ fn unpublishable_crate() {
384390
description = "foo"
385391
publish = false
386392
"#,
387-
).file("src/main.rs", "fn main() {}")
393+
)
394+
.file("src/main.rs", "fn main() {}")
388395
.build();
389396

390397
p.cargo("publish --index")
@@ -417,7 +424,8 @@ fn dont_publish_dirty() {
417424
homepage = "foo"
418425
repository = "foo"
419426
"#,
420-
).file("src/main.rs", "fn main() {}")
427+
)
428+
.file("src/main.rs", "fn main() {}")
421429
.build();
422430

423431
p.cargo("publish --index")
@@ -456,7 +464,8 @@ fn publish_clean() {
456464
homepage = "foo"
457465
repository = "foo"
458466
"#,
459-
).file("src/main.rs", "fn main() {}")
467+
)
468+
.file("src/main.rs", "fn main() {}")
460469
.build();
461470

462471
p.cargo("publish --index")
@@ -484,7 +493,8 @@ fn publish_in_sub_repo() {
484493
homepage = "foo"
485494
repository = "foo"
486495
"#,
487-
).file("bar/src/main.rs", "fn main() {}")
496+
)
497+
.file("bar/src/main.rs", "fn main() {}")
488498
.build();
489499

490500
p.cargo("publish")
@@ -514,7 +524,8 @@ fn publish_when_ignored() {
514524
homepage = "foo"
515525
repository = "foo"
516526
"#,
517-
).file("src/main.rs", "fn main() {}")
527+
)
528+
.file("src/main.rs", "fn main() {}")
518529
.file(".gitignore", "baz")
519530
.build();
520531

@@ -594,7 +605,8 @@ fn dry_run() {
594605
license = "MIT"
595606
description = "foo"
596607
"#,
597-
).file("src/main.rs", "fn main() {}")
608+
)
609+
.file("src/main.rs", "fn main() {}")
598610
.build();
599611

600612
p.cargo("publish --dry-run --index")
@@ -635,7 +647,8 @@ fn block_publish_feature_not_enabled() {
635647
"test"
636648
]
637649
"#,
638-
).file("src/main.rs", "fn main() {}")
650+
)
651+
.file("src/main.rs", "fn main() {}")
639652
.build();
640653

641654
p.cargo("publish --registry alternative -Zunstable-options")
@@ -676,7 +689,8 @@ fn registry_not_in_publish_list() {
676689
"test"
677690
]
678691
"#,
679-
).file("src/main.rs", "fn main() {}")
692+
)
693+
.file("src/main.rs", "fn main() {}")
680694
.build();
681695

682696
p.cargo("publish")
@@ -711,7 +725,8 @@ fn publish_empty_list() {
711725
description = "foo"
712726
publish = []
713727
"#,
714-
).file("src/main.rs", "fn main() {}")
728+
)
729+
.file("src/main.rs", "fn main() {}")
715730
.build();
716731

717732
p.cargo("publish --registry alternative -Zunstable-options")
@@ -747,7 +762,8 @@ fn publish_allowed_registry() {
747762
homepage = "foo"
748763
publish = ["alternative"]
749764
"#,
750-
).file("src/main.rs", "fn main() {}")
765+
)
766+
.file("src/main.rs", "fn main() {}")
751767
.build();
752768

753769
p.cargo("publish --registry alternative -Zunstable-options")
@@ -773,7 +789,8 @@ fn block_publish_no_registry() {
773789
description = "foo"
774790
publish = []
775791
"#,
776-
).file("src/main.rs", "fn main() {}")
792+
)
793+
.file("src/main.rs", "fn main() {}")
777794
.build();
778795

779796
p.cargo("publish --registry alternative -Zunstable-options")
@@ -809,7 +826,8 @@ fn publish_with_select_features() {
809826
required = []
810827
optional = []
811828
"#,
812-
).file(
829+
)
830+
.file(
813831
"src/main.rs",
814832
"#[cfg(not(required))]
815833
compile_error!(\"This crate requires `required` feature!\");
@@ -849,7 +867,8 @@ fn publish_with_all_features() {
849867
required = []
850868
optional = []
851869
"#,
852-
).file(
870+
)
871+
.file(
853872
"src/main.rs",
854873
"#[cfg(not(required))]
855874
compile_error!(\"This crate requires `required` feature!\");

0 commit comments

Comments
 (0)