Skip to content

Commit c74335b

Browse files
steffahndjc
authored andcommitted
Remove the mixed singular/plural phrasing as "component(s)"
instead, use "components" or "component". In the singular case also add the name of the component for more consistent messaging style with other info! outputs about single components. Added during review: The plural case now also displays the number of components; and the snapshot tests are being updated.
1 parent 9cb586b commit c74335b

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

src/dist/manifestation.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,15 @@ impl Manifestation {
217217
}
218218

219219
if !components.is_empty() {
220-
info!("downloading component(s)");
220+
if components.len() > 2 {
221+
info!("downloading {} components", components.len());
222+
} else {
223+
info!(
224+
"downloading component {}",
225+
components[0].manifest.short_name(&components[0].component),
226+
);
227+
};
228+
221229
let mut stream = InstallEvents::new(components.into_iter(), Arc::new(self));
222230
let mut transaction = Some(tx);
223231
tx = loop {

tests/suite/cli_exact.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ async fn update_once() {
2222
.with_stderr(snapbox::str![[r#"
2323
info: syncing channel updates for nightly-[HOST_TRIPLE]
2424
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
25-
info: downloading component[..]
26-
...
25+
info: downloading 4 components
2726
info: default toolchain set to nightly-[HOST_TRIPLE]
2827
2928
"#]]);
@@ -69,8 +68,8 @@ rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION]
6968
.with_stderr(snapbox::str![[r#"
7069
info: syncing channel updates for nightly-[HOST_TRIPLE]
7170
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
72-
info: downloading component[..]
73-
...
71+
info: downloading 4 components
72+
7473
"#]]);
7574
cx.config
7675
.expect(["rustup", "+nightly", "component", "list", "--installed"])
@@ -112,8 +111,7 @@ async fn update_once_and_self_update() {
112111
.with_stderr(snapbox::str![[r#"
113112
info: syncing channel updates for nightly-[HOST_TRIPLE]
114113
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
115-
info: downloading component[..]
116-
...
114+
info: downloading 4 components
117115
info: checking for self-update (current version: [CURRENT_VERSION])
118116
info: downloading self-update (new version: [TEST_VERSION])
119117
@@ -323,8 +321,7 @@ async fn default() {
323321
.with_stderr(snapbox::str![[r#"
324322
info: syncing channel updates for nightly-[HOST_TRIPLE]
325323
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
326-
info: downloading component[..]
327-
...
324+
info: downloading 4 components
328325
info: default toolchain set to nightly-[HOST_TRIPLE]
329326
330327
"#]]);

tests/suite/cli_rustup.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ async fn default() {
284284
.with_stderr(snapbox::str![[r#"
285285
info: syncing channel updates for nightly-[HOST_TRIPLE]
286286
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
287-
info: downloading component[..]
288-
...
287+
info: downloading 4 components
289288
info: default toolchain set to nightly-[HOST_TRIPLE]
290289
291290
"#]])
@@ -1708,8 +1707,7 @@ channel = "nightly"
17081707
.with_stderr(snapbox::str![[r#"
17091708
info: syncing channel updates for nightly-[HOST_TRIPLE]
17101709
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
1711-
info: downloading component[..]
1712-
...
1710+
info: downloading component rustc
17131711
info: the active toolchain `nightly-[HOST_TRIPLE]` has been installed
17141712
info: it's active because: overridden by '[TOOLCHAIN_FILE]'
17151713
@@ -3893,8 +3891,7 @@ async fn custom_toolchain_with_components_toolchains_profile_does_not_err() {
38933891
.with_stderr(snapbox::str![[r#"
38943892
info: syncing channel updates for nightly-[HOST_TRIPLE]
38953893
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
3896-
info: downloading component[..]
3897-
...
3894+
info: downloading component cargo
38983895
info: default toolchain set to nightly-[HOST_TRIPLE]
38993896
39003897
"#]])

tests/suite/cli_rustup_ui/rustup_default.stderr.term.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/suite/cli_rustup_ui/rustup_update_updated.stderr.term.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/suite/cli_self_upd.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ async fn install_bins_to_cargo_home() {
7272
...
7373
info: syncing channel updates for stable-[HOST_TRIPLE]
7474
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
75-
info: downloading component[..]
76-
...
75+
info: downloading 4 components
7776
info: default toolchain set to stable-[HOST_TRIPLE]
7877
7978
"#]])
@@ -117,8 +116,7 @@ async fn proxies_are_relative_symlinks() {
117116
...
118117
info: syncing channel updates for stable-[HOST_TRIPLE]
119118
info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0)
120-
info: downloading component[..]
121-
...
119+
info: downloading 4 components
122120
info: default toolchain set to stable-[HOST_TRIPLE]
123121
...
124122
"#]])

tests/suite/cli_v2.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ async fn remove_override_toolchain_err_handling() {
487487
.with_stderr(snapbox::str![[r#"
488488
info: syncing channel updates for beta-[HOST_TRIPLE]
489489
info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0)
490-
info: downloading component[..]
491-
...
490+
info: downloading 4 components
491+
492492
"#]])
493493
.is_ok();
494494
cx.config
@@ -520,8 +520,8 @@ async fn file_override_toolchain_err_handling() {
520520
.with_stderr(snapbox::str![[r#"
521521
info: syncing channel updates for beta-[HOST_TRIPLE]
522522
info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0)
523-
info: downloading component[..]
524-
...
523+
info: downloading 4 components
524+
525525
"#]])
526526
.is_ok();
527527
cx.config
@@ -2481,8 +2481,8 @@ async fn run_with_install_flag_against_unavailable_component() {
24812481
info: syncing channel updates for nightly-[HOST_TRIPLE]
24822482
info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2)
24832483
warn: skipping unavailable component rust-std
2484-
info: downloading component[..]
2485-
...
2484+
info: downloading 3 components
2485+
24862486
"#]])
24872487
.is_ok();
24882488
cx.config

0 commit comments

Comments
 (0)