Skip to content

Commit aa68ea7

Browse files
committed
refactor(publish): Clarify we prepare_transmit using the local package
1 parent 09eb536 commit aa68ea7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/cargo/ops/registry/publish.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ fn verify_dependencies(
323323

324324
fn transmit(
325325
gctx: &GlobalContext,
326-
pkg: &Package,
326+
local_pkg: &Package,
327327
tarball: &File,
328328
registry: &mut Registry,
329329
registry_id: SourceId,
330330
dry_run: bool,
331331
) -> CargoResult<()> {
332-
let deps = pkg
332+
let deps = local_pkg
333333
.dependencies()
334334
.iter()
335335
.filter(|dep| {
@@ -380,7 +380,7 @@ fn transmit(
380380
})
381381
})
382382
.collect::<CargoResult<Vec<NewCrateDependency>>>()?;
383-
let manifest = pkg.manifest();
383+
let manifest = local_pkg.manifest();
384384
let ManifestMetadata {
385385
ref authors,
386386
ref description,
@@ -400,12 +400,13 @@ fn transmit(
400400
let readme_content = readme
401401
.as_ref()
402402
.map(|readme| {
403-
paths::read(&pkg.root().join(readme))
404-
.with_context(|| format!("failed to read `readme` file for package `{}`", pkg))
403+
paths::read(&local_pkg.root().join(readme)).with_context(|| {
404+
format!("failed to read `readme` file for package `{}`", local_pkg)
405+
})
405406
})
406407
.transpose()?;
407408
if let Some(ref file) = *license_file {
408-
if !pkg.root().join(file).exists() {
409+
if !local_pkg.root().join(file).exists() {
409410
bail!("the license file `{}` does not exist", file)
410411
}
411412
}
@@ -450,8 +451,8 @@ fn transmit(
450451
let warnings = registry
451452
.publish(
452453
&NewCrate {
453-
name: pkg.name().to_string(),
454-
vers: pkg.version().to_string(),
454+
name: local_pkg.name().to_string(),
455+
vers: local_pkg.version().to_string(),
455456
deps,
456457
features: string_features,
457458
authors: authors.clone(),

0 commit comments

Comments
 (0)