Skip to content

Commit 7909352

Browse files
committed
Better format
Better format
1 parent 8230096 commit 7909352

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/cli/rustup_mode.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,14 +1197,13 @@ fn show_active_toolchain(cfg: &Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCod
11971197
Err(e) => return Err(e.into()),
11981198
Ok((toolchain, reason)) => {
11991199
if let Some(reason) = reason {
1200-
write!(process().stdout(), "{} ({})", toolchain.name(), reason,)?;
1200+
writeln!(process().stdout(), "{} ({})", toolchain.name(), reason,)?;
12011201
} else {
1202-
write!(process().stdout(), "{} (default)", toolchain.name(),)?;
1202+
writeln!(process().stdout(), "{} (default)", toolchain.name(),)?;
12031203
}
12041204
if verbose {
1205-
write!(process().stdout(), " - {}", toolchain.rustc_version())?;
1205+
writeln!(process().stdout(), "{}", toolchain.rustc_version())?;
12061206
}
1207-
writeln!(process().stdout())?
12081207
}
12091208
}
12101209
Ok(utils::ExitCode(0))

tests/cli-rustup.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,8 @@ fn show_active_toolchain_with_verbose() {
10901090
config,
10911091
&["rustup", "show", "active-toolchain", "--verbose"],
10921092
for_host!(
1093-
r"nightly-{0} (default) - 1.3.0 (hash-nightly-2)
1093+
r"nightly-{0} (default)
1094+
1.3.0 (hash-nightly-2)
10941095
"
10951096
),
10961097
r"",

0 commit comments

Comments
 (0)