Skip to content

Commit 95cf038

Browse files
committed
Auto merge of #9734 - ehuss:fix-version-beta, r=alexcrichton
[Beta] backport version string fix Beta backport of #9727 for 1.55.
2 parents cebef29 + 45a309e commit 95cf038

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/bin/cargo/cli.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ Run with 'cargo -Z [FLAG] [SUBCOMMAND]'",
137137

138138
pub fn get_version_string(is_verbose: bool) -> String {
139139
let version = cargo::version();
140-
let mut version_string = version.to_string();
141-
version_string.push('\n');
140+
let mut version_string = format!("cargo {}\n", version);
142141
if is_verbose {
143142
version_string.push_str(&format!(
144143
"release: {}.{}.{}\n",

tests/testsuite/version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ fn simple() {
77
let p = project().build();
88

99
p.cargo("version")
10-
.with_stdout(&format!("{}\n", cargo::version()))
10+
.with_stdout(&format!("cargo {}\n", cargo::version()))
1111
.run();
1212

1313
p.cargo("--version")
14-
.with_stdout(&format!("{}\n", cargo::version()))
14+
.with_stdout(&format!("cargo {}\n", cargo::version()))
1515
.run();
1616
}
1717

0 commit comments

Comments
 (0)