Skip to content

Commit

Permalink
Inline trivial single-use function utils::to_absolute()
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jun 5, 2024
1 parent a13aa3b commit ee1fa08
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
6 changes: 0 additions & 6 deletions src/utils/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,6 @@ pub fn current_exe() -> Result<PathBuf> {
env::current_exe().context(RustupError::LocatingWorkingDir)
}

pub(crate) fn to_absolute<P: AsRef<Path>>(path: P, cwd: &Path) -> PathBuf {
let mut new = PathBuf::from(cwd);
new.push(path);
new
}

pub(crate) fn home_dir() -> Option<PathBuf> {
home::home_dir_with_env(&home_process())
}
Expand Down

0 comments on commit ee1fa08

Please sign in to comment.