Skip to content

Commit ba789f0

Browse files
committed
fix(publish): Pluralize the wait message
1 parent 8c401a2 commit ba789f0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/cargo/ops/registry/publish.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
274274
let short_pkg_descriptions = package_list(to_confirm.iter().copied(), "or");
275275
opts.gctx.shell().note(format!(
276276
"waiting for {short_pkg_descriptions} to be available at {source_description}.\n\
277-
You may press ctrl-c to skip waiting; the crate should be available shortly."
277+
You may press ctrl-c to skip waiting; the {crate} should be available shortly.",
278+
crate = if to_confirm.len() == 1 { "crate" } else {"crates"}
278279
))?;
279280

280281
let timeout = Duration::from_secs(timeout);
@@ -299,10 +300,15 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
299300
opts.gctx.shell().warn(format!(
300301
"timed out waiting for {short_pkg_descriptions} to be available in {source_description}",
301302
))?;
302-
opts.gctx.shell().note(
303+
opts.gctx.shell().note(format!(
303304
"the registry may have a backlog that is delaying making the \
304-
crate available. The crate should be available soon.",
305-
)?;
305+
{crate} available. The {crate} should be available soon.",
306+
crate = if to_confirm.len() == 1 {
307+
"crate"
308+
} else {
309+
"crates"
310+
}
311+
))?;
306312
}
307313
confirmed
308314
} else {

tests/testsuite/publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3890,7 +3890,7 @@ fn workspace_parallel() {
38903890
[UPLOADED] b v0.0.1 to registry `crates-io`
38913891
[UPLOADED] a v0.0.1 to registry `crates-io`
38923892
[NOTE] waiting for `a v0.0.1` or `b v0.0.1` to be available at registry `crates-io`.
3893-
You may press ctrl-c to skip waiting; the crate should be available shortly.
3893+
You may press ctrl-c to skip waiting; the crates should be available shortly.
38943894
[PUBLISHED] a v0.0.1, b v0.0.1 at registry `crates-io`
38953895
[UPLOADING] c v0.0.1 ([ROOT]/foo/c)
38963896
[UPLOADED] c v0.0.1 to registry `crates-io`

0 commit comments

Comments
 (0)