Skip to content

Commit 67a2300

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

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/cli/rustup_mode.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ pub fn main() -> Result<utils::ExitCode> {
684684
SetSubcmd::DefaultHost { host_triple } => cfg
685685
.set_default_host_triple(host_triple)
686686
.map(|_| utils::ExitCode(0)),
687-
SetSubcmd::Profile { profile_name } => set_profile(cfg, &profile_name),
687+
SetSubcmd::Profile { profile_name } => {
688+
cfg.set_profile(&profile_name).map(|_| utils::ExitCode(0))
689+
}
688690
SetSubcmd::AutoSelfUpdate {
689691
auto_self_update_mode,
690692
} => set_auto_self_update(cfg, &auto_self_update_mode),
@@ -1490,11 +1492,6 @@ fn man(
14901492
Ok(utils::ExitCode(0))
14911493
}
14921494

1493-
fn set_profile(cfg: &mut Cfg, profile: &str) -> Result<utils::ExitCode> {
1494-
cfg.set_profile(profile)?;
1495-
Ok(utils::ExitCode(0))
1496-
}
1497-
14981495
fn set_auto_self_update(cfg: &mut Cfg, auto_self_update_mode: &str) -> Result<utils::ExitCode> {
14991496
if self_update::NEVER_SELF_UPDATE {
15001497
let mut args = process().args_os();

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ fn current_install_opts(opts: &InstallOpts<'_>) -> String {
694694
",
695695
opts.default_host_triple
696696
.as_ref()
697-
.map(|s| TargetTriple::new(s))
697+
.map(TargetTriple::new)
698698
.unwrap_or_else(TargetTriple::from_host_or_build),
699699
opts.default_toolchain
700700
.as_ref()

0 commit comments

Comments
 (0)