Skip to content

Commit

Permalink
Auto merge of #11651 - hi-rustin:rustin-patch-comment, r=weihanglo
Browse files Browse the repository at this point in the history
Fix the wrong comment

It should be for modifying the owners of a crate.
  • Loading branch information
bors committed Feb 1, 2023
2 parents 582246c + 7a44eb6 commit a40a64b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
&reg_ids.original,
None,
Some(mutation),
mutation,
)?));
}

Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a40a64b

Please sign in to comment.