Skip to content

Commit

Permalink
refactor(cli): hoist the handle_epipe() call out of the match
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed May 12, 2024
1 parent bb9ab78 commit fcff18c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,14 @@ impl RustupSubcmd {
RustupSubcmd::DumpTestament => common::dump_testament(),
RustupSubcmd::Install { opts } => update(cfg, opts),
RustupSubcmd::Uninstall { opts } => toolchain_remove(cfg, opts),
RustupSubcmd::Show { verbose, subcmd } => match subcmd {
None => handle_epipe(show(cfg, verbose)),
RustupSubcmd::Show { verbose, subcmd } => handle_epipe(match subcmd {
None => show(cfg, verbose),
Some(ShowSubcmd::ActiveToolchain { verbose }) => {
handle_epipe(show_active_toolchain(cfg, verbose))
show_active_toolchain(cfg, verbose)
}
Some(ShowSubcmd::Home) => handle_epipe(show_rustup_home(cfg)),
Some(ShowSubcmd::Profile) => handle_epipe(show_profile(cfg)),
},
Some(ShowSubcmd::Home) => show_rustup_home(cfg),
Some(ShowSubcmd::Profile) => show_profile(cfg),
}),
RustupSubcmd::Update {
toolchain,
no_self_update,
Expand Down

0 comments on commit fcff18c

Please sign in to comment.