Skip to content

Commit c268254

Browse files
committed
Inline trivial single-use function
1 parent 67a2300 commit c268254

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/cli/rustup_mode.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,10 @@ pub fn main() -> Result<utils::ExitCode> {
601601
None => show(cfg, verbose),
602602
Some(ShowSubcmd::ActiveToolchain { verbose }) => show_active_toolchain(cfg, verbose),
603603
Some(ShowSubcmd::Home) => show_rustup_home(cfg),
604-
Some(ShowSubcmd::Profile) => show_profile(cfg),
604+
Some(ShowSubcmd::Profile) => {
605+
writeln!(process().stdout().lock(), "{}", cfg.get_profile()?)?;
606+
Ok(ExitCode(0))
607+
}
605608
}),
606609
RustupSubcmd::Update {
607610
toolchain,
@@ -1506,12 +1509,6 @@ fn set_auto_self_update(cfg: &mut Cfg, auto_self_update_mode: &str) -> Result<ut
15061509
Ok(utils::ExitCode(0))
15071510
}
15081511

1509-
#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
1510-
fn show_profile(cfg: &Cfg) -> Result<utils::ExitCode> {
1511-
writeln!(process().stdout().lock(), "{}", cfg.get_profile()?)?;
1512-
Ok(utils::ExitCode(0))
1513-
}
1514-
15151512
#[derive(Copy, Clone, Debug, PartialEq)]
15161513
pub(crate) enum CompletionCommand {
15171514
Rustup,

0 commit comments

Comments
 (0)