Skip to content

Commit a40a64b

Browse files
committed
Auto merge of #11651 - hi-rustin:rustin-patch-comment, r=weihanglo
Fix the wrong comment It should be for modifying the owners of a crate.
2 parents 582246c + 7a44eb6 commit a40a64b

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/cargo/ops/registry.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,20 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
202202
)?
203203
.unwrap();
204204

205-
let hash = cargo_util::Sha256::new()
206-
.update_file(tarball.file())?
207-
.finish_hex();
208-
let mutation = auth::Mutation::Publish {
209-
name: pkg.name().as_str(),
210-
vers: &ver,
211-
cksum: &hash,
212-
};
213-
214205
if !opts.dry_run {
206+
let hash = cargo_util::Sha256::new()
207+
.update_file(tarball.file())?
208+
.finish_hex();
209+
let mutation = Some(auth::Mutation::Publish {
210+
name: pkg.name().as_str(),
211+
vers: &ver,
212+
cksum: &hash,
213+
});
215214
registry.set_token(Some(auth::auth_token(
216215
&opts.config,
217216
&reg_ids.original,
218217
None,
219-
Some(mutation),
218+
mutation,
220219
)?));
221220
}
222221

src/cargo/util/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ pub enum Mutation<'a> {
579579
/// The version of the crate
580580
vers: &'a str,
581581
},
582-
/// The user is attempting to unyank a crate.
582+
/// The user is attempting to modify the owners of a crate.
583583
Owners {
584584
/// The name of the crate
585585
name: &'a str,

0 commit comments

Comments
 (0)