diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 091c26b6070..0584a771457 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -202,21 +202,20 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> { )? .unwrap(); - let hash = cargo_util::Sha256::new() - .update_file(tarball.file())? - .finish_hex(); - let mutation = auth::Mutation::Publish { - name: pkg.name().as_str(), - vers: &ver, - cksum: &hash, - }; - if !opts.dry_run { + let hash = cargo_util::Sha256::new() + .update_file(tarball.file())? + .finish_hex(); + let mutation = Some(auth::Mutation::Publish { + name: pkg.name().as_str(), + vers: &ver, + cksum: &hash, + }); registry.set_token(Some(auth::auth_token( &opts.config, ®_ids.original, None, - Some(mutation), + mutation, )?)); } diff --git a/src/cargo/util/auth.rs b/src/cargo/util/auth.rs index 467abc2635a..2a70ea37e27 100644 --- a/src/cargo/util/auth.rs +++ b/src/cargo/util/auth.rs @@ -579,7 +579,7 @@ pub enum Mutation<'a> { /// The version of the crate vers: &'a str, }, - /// The user is attempting to unyank a crate. + /// The user is attempting to modify the owners of a crate. Owners { /// The name of the crate name: &'a str,