Skip to content

Commit

Permalink
Inline trivial single-use function
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed May 16, 2024
1 parent 7d88d83 commit f39f2a7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,10 @@ pub fn main() -> Result<utils::ExitCode> {
None => show(cfg, verbose),
Some(ShowSubcmd::ActiveToolchain { verbose }) => show_active_toolchain(cfg, verbose),
Some(ShowSubcmd::Home) => show_rustup_home(cfg),
Some(ShowSubcmd::Profile) => show_profile(cfg),
Some(ShowSubcmd::Profile) => {
writeln!(process().stdout().lock(), "{}", cfg.get_profile()?)?;
Ok(ExitCode(0))
}
}),
RustupSubcmd::Update {
toolchain,
Expand Down Expand Up @@ -1515,12 +1518,6 @@ fn set_auto_self_update(cfg: &mut Cfg, auto_self_update_mode: &str) -> Result<ut
Ok(utils::ExitCode(0))
}

#[cfg_attr(feature = "otel", tracing::instrument(skip_all))]
fn show_profile(cfg: &Cfg) -> Result<utils::ExitCode> {
writeln!(process().stdout().lock(), "{}", cfg.get_profile()?)?;
Ok(utils::ExitCode(0))
}

#[derive(Copy, Clone, Debug, PartialEq)]
pub(crate) enum CompletionCommand {
Rustup,
Expand Down

0 comments on commit f39f2a7

Please sign in to comment.