Skip to content

Commit 7bf7b2f

Browse files
committed
fix(compile): Match rustc style guide for help message casing
1 parent 86dcd23 commit 7bf7b2f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/cargo/ops/cargo_compile/unit_generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl<'a> UnitGenerator<'a, '_> {
275275
for (package, targets) in &targets_elsewhere {
276276
if !targets.is_empty() {
277277
available_msg.push(format!(
278-
"help: Available {target_desc} in `{package}` package:"
278+
"help: available {target_desc} in `{package}` package:"
279279
));
280280
for target in targets {
281281
available_msg.push(format!(" {target}"));
@@ -314,7 +314,7 @@ impl<'a> UnitGenerator<'a, '_> {
314314
if !targets_elsewhere.is_empty() {
315315
append_targets_elsewhere(&mut msg)?;
316316
} else if suggestion.is_empty() && !targets.is_empty() {
317-
write!(msg, "\nAvailable {} targets:", target_desc)?;
317+
write!(msg, "\navailable {} targets:", target_desc)?;
318318
for target in targets {
319319
write!(msg, "\n {}", target.name())?;
320320
}

tests/testsuite/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,7 @@ fn cargo_compile_with_filename() {
13381338
.with_status(101)
13391339
.with_stderr_data(str![[r#"
13401340
[ERROR] no bin target named `bin.rs` in default-run packages
1341-
Available bin targets:
1341+
available bin targets:
13421342
a
13431343
13441344
"#]])
@@ -1358,7 +1358,7 @@ Available bin targets:
13581358
.with_status(101)
13591359
.with_stderr_data(str![[r#"
13601360
[ERROR] no example target named `example.rs` in default-run packages
1361-
Available example targets:
1361+
available example targets:
13621362
a
13631363
13641364
"#]])

tests/testsuite/run.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ automatically infer them to be a target, such as in subfolders.
624624
For more information on this warning you can consult
625625
https://github.com/rust-lang/cargo/issues/5330
626626
[ERROR] no example target named `a` in default-run packages
627-
Available example targets:
627+
available example targets:
628628
do_magic
629629
630630
"#]])
@@ -655,7 +655,7 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
655655
.with_status(101)
656656
.with_stderr_data(str![[r#"
657657
[ERROR] no example target named `a` in default-run packages
658-
Available example targets:
658+
available example targets:
659659
do_magic
660660
661661
"#]])
@@ -742,7 +742,7 @@ fn run_with_filename() {
742742
.with_status(101)
743743
.with_stderr_data(str![[r#"
744744
[ERROR] no bin target named `bin.rs` in default-run packages
745-
Available bin targets:
745+
available bin targets:
746746
a
747747
748748
"#]])
@@ -762,7 +762,7 @@ Available bin targets:
762762
.with_status(101)
763763
.with_stderr_data(str![[r#"
764764
[ERROR] no example target named `example.rs` in default-run packages
765-
Available example targets:
765+
available example targets:
766766
a
767767
768768
"#]])
@@ -844,7 +844,7 @@ fn ambiguous_bin_name() {
844844
.with_status(101)
845845
.with_stderr_data(str![[r#"
846846
[ERROR] no bin target named `crate1/ambiguous` in default-run packages
847-
Available bin targets:
847+
available bin targets:
848848
ambiguous
849849
ambiguous
850850
ambiguous
@@ -937,7 +937,7 @@ Available binaries:
937937
[ERROR] no bin target named `crate2` in `crate1` package
938938
939939
[HELP] a target with a similar name exists: `crate1`
940-
[HELP] Available bin in `crate2` package:
940+
[HELP] available bin in `crate2` package:
941941
crate2
942942
943943
"#]])
@@ -949,7 +949,7 @@ Available binaries:
949949
[ERROR] no bin target named `crate2` in `crate1`, ... packages
950950
951951
[HELP] a target with a similar name exists: `crate1`
952-
[HELP] Available bin in `crate2` package:
952+
[HELP] available bin in `crate2` package:
953953
crate2
954954
955955
"#]])
@@ -961,7 +961,7 @@ Available binaries:
961961
[ERROR] no bin target named `crate2` in default-run packages
962962
963963
[HELP] a target with a similar name exists: `crate1`
964-
[HELP] Available bin in `crate2` package:
964+
[HELP] available bin in `crate2` package:
965965
crate2
966966
967967
"#]])
@@ -971,9 +971,9 @@ Available binaries:
971971
.with_status(101)
972972
.with_stderr_data(str![[r#"
973973
[ERROR] no bin target matches pattern `pattern*` in default-run packages
974-
[HELP] Available bin in `pattern1` package:
974+
[HELP] available bin in `pattern1` package:
975975
pattern1
976-
[HELP] Available bin in `pattern2` package:
976+
[HELP] available bin in `pattern2` package:
977977
pattern2
978978
979979
"#]])
@@ -996,7 +996,7 @@ Available binaries:
996996
.with_status(101)
997997
.with_stderr_data(str![[r#"
998998
[ERROR] no bin target named `crate2` in default-run packages
999-
[HELP] Available bin in `crate2` package:
999+
[HELP] available bin in `crate2` package:
10001000
crate2
10011001
10021002
"#]])

0 commit comments

Comments
 (0)