From 40cca8058d1126cf4ec89feb08c9bf317662dd8f Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sat, 29 Dec 2018 16:33:20 +0100 Subject: [PATCH] Undoing bad formatting changes and removing redundant struct fields --- src/bin/cargo/commands/package.rs | 1 - src/cargo/ops/cargo_package.rs | 1 - src/cargo/ops/registry.rs | 1 - tests/testsuite/package.rs | 4 --- tests/testsuite/publish.rs | 57 ++++++++++++++++++++----------- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/bin/cargo/commands/package.rs b/src/bin/cargo/commands/package.rs index 3d0c020efa6..32bc431dbfe 100644 --- a/src/bin/cargo/commands/package.rs +++ b/src/bin/cargo/commands/package.rs @@ -43,7 +43,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult { allow_dirty: args.is_present("allow-dirty"), target: args.target(), jobs: args.jobs()?, - registry: None, features: args._values_of("features"), all_features: args.is_present("all-features"), }, diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 27ffca66be9..47601667a2e 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -26,7 +26,6 @@ pub struct PackageOpts<'cfg> { pub verify: bool, pub jobs: Option, pub target: Option, - pub registry: Option, pub features: Vec, pub all_features: bool, } diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 9c464a81384..9777394ba7c 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -84,7 +84,6 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> { allow_dirty: opts.allow_dirty, target: opts.target.clone(), jobs: opts.jobs, - registry: opts.registry.clone(), features: opts.features.clone(), all_features: opts.all_features, }, diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index ef01032124c..ba4d3e7aec3 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -1305,8 +1305,6 @@ fn package_with_select_features() { .file( "Cargo.toml", r#" - cargo-features = ["alternative-registries"] - [project] name = "foo" version = "0.0.1" @@ -1337,8 +1335,6 @@ fn package_with_all_features() { .file( "Cargo.toml", r#" - cargo-features = ["alternative-registries"] - [project] name = "foo" version = "0.0.1" diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index fd59a925b71..dca4e92c9ac 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -23,7 +23,8 @@ fn simple() { license = "MIT" description = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --no-verify --index") @@ -96,7 +97,8 @@ fn old_token_location() { license = "MIT" description = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --no-verify --index") @@ -162,7 +164,8 @@ fn simple_with_host() { license = "MIT" description = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --no-verify --host") @@ -237,7 +240,8 @@ fn simple_with_index_and_host() { license = "MIT" description = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --no-verify --index") @@ -315,7 +319,8 @@ fn git_deps() { [dependencies.foo] git = "git://path/to/nowhere" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish -v --no-verify --index") @@ -351,7 +356,8 @@ fn path_dependency_no_version() { [dependencies.bar] path = "bar" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1")) .file("bar/src/lib.rs", "") .build(); @@ -384,7 +390,8 @@ fn unpublishable_crate() { description = "foo" publish = false "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --index") @@ -417,7 +424,8 @@ fn dont_publish_dirty() { homepage = "foo" repository = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --index") @@ -456,7 +464,8 @@ fn publish_clean() { homepage = "foo" repository = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --index") @@ -484,7 +493,8 @@ fn publish_in_sub_repo() { homepage = "foo" repository = "foo" "#, - ).file("bar/src/main.rs", "fn main() {}") + ) + .file("bar/src/main.rs", "fn main() {}") .build(); p.cargo("publish") @@ -514,7 +524,8 @@ fn publish_when_ignored() { homepage = "foo" repository = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .file(".gitignore", "baz") .build(); @@ -594,7 +605,8 @@ fn dry_run() { license = "MIT" description = "foo" "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --dry-run --index") @@ -635,7 +647,8 @@ fn block_publish_feature_not_enabled() { "test" ] "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --registry alternative -Zunstable-options") @@ -676,7 +689,8 @@ fn registry_not_in_publish_list() { "test" ] "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish") @@ -711,7 +725,8 @@ fn publish_empty_list() { description = "foo" publish = [] "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --registry alternative -Zunstable-options") @@ -747,7 +762,8 @@ fn publish_allowed_registry() { homepage = "foo" publish = ["alternative"] "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --registry alternative -Zunstable-options") @@ -773,7 +789,8 @@ fn block_publish_no_registry() { description = "foo" publish = [] "#, - ).file("src/main.rs", "fn main() {}") + ) + .file("src/main.rs", "fn main() {}") .build(); p.cargo("publish --registry alternative -Zunstable-options") @@ -809,7 +826,8 @@ fn publish_with_select_features() { required = [] optional = [] "#, - ).file( + ) + .file( "src/main.rs", "#[cfg(not(required))] compile_error!(\"This crate requires `required` feature!\"); @@ -849,7 +867,8 @@ fn publish_with_all_features() { required = [] optional = [] "#, - ).file( + ) + .file( "src/main.rs", "#[cfg(not(required))] compile_error!(\"This crate requires `required` feature!\");