From ae64d518ee7b1ec56d096f78ca99f1e46a7f80c6 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 5 Jun 2024 10:47:59 +0200 Subject: [PATCH] Inline trivial single-use function utils::to_absolute() --- src/cli/rustup_mode.rs | 2 +- src/utils/utils.rs | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 347cd973eb8..ae8212b4084 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -1267,7 +1267,7 @@ async fn toolchain_link( if true { InstallMethod::Link { - src: &utils::to_absolute(src, &cfg.current_dir), + src: &cfg.current_dir.join(src), dest, cfg, } diff --git a/src/utils/utils.rs b/src/utils/utils.rs index a0b15c45de1..5dc3d53b60a 100644 --- a/src/utils/utils.rs +++ b/src/utils/utils.rs @@ -495,12 +495,6 @@ pub fn current_exe() -> Result { env::current_exe().context(RustupError::LocatingWorkingDir) } -pub(crate) fn to_absolute>(path: P, cwd: &Path) -> PathBuf { - let mut new = PathBuf::from(cwd); - new.push(path); - new -} - pub(crate) fn home_dir() -> Option { home::home_dir_with_env(&home_process()) }