diff --git a/crates/volta-core/src/tool/npm/fetch.rs b/crates/volta-core/src/tool/npm/fetch.rs index e8ac4d523..9c960a863 100644 --- a/crates/volta-core/src/tool/npm/fetch.rs +++ b/crates/volta-core/src/tool/npm/fetch.rs @@ -1,7 +1,7 @@ //! Provides fetcher for npm distributions use std::fs::{write, File}; -use std::path::{Path, PathBuf}; +use std::path::Path; use super::super::download_tool_error; use super::super::registry::public_registry_package; @@ -108,7 +108,7 @@ fn unpack_archive(archive: Box, version: &Version) -> Fallible<()> /// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of /// downloading. /// ISSUE(#134) - verify checksum -fn load_cached_distro(file: &PathBuf) -> Option> { +fn load_cached_distro(file: &Path) -> Option> { if file.is_file() { let file = File::open(file).ok()?; Tarball::load(file).ok() diff --git a/crates/volta-core/src/tool/yarn/fetch.rs b/crates/volta-core/src/tool/yarn/fetch.rs index 486f85389..e42bf84fb 100644 --- a/crates/volta-core/src/tool/yarn/fetch.rs +++ b/crates/volta-core/src/tool/yarn/fetch.rs @@ -1,7 +1,7 @@ //! Provides fetcher for Yarn distributions use std::fs::File; -use std::path::{Path, PathBuf}; +use std::path::Path; use super::super::download_tool_error; use super::super::registry::{find_unpack_dir, public_registry_package}; @@ -101,7 +101,7 @@ fn unpack_archive(archive: Box, version: &Version) -> Fallible<()> /// Return the archive if it is valid. It may have been corrupted or interrupted in the middle of /// downloading. // ISSUE(#134) - verify checksum -fn load_cached_distro(file: &PathBuf) -> Option> { +fn load_cached_distro(file: &Path) -> Option> { if file.is_file() { let file = File::open(file).ok()?; Tarball::load(file).ok() diff --git a/src/command/setup.rs b/src/command/setup.rs index c16d9fe8a..96b8a62d0 100644 --- a/src/command/setup.rs +++ b/src/command/setup.rs @@ -84,10 +84,8 @@ mod os { fn determine_profiles() -> Fallible> { let home_dir = dirs::home_dir().ok_or(ErrorKind::NoHomeEnvironmentVar)?; let shell = env::var("SHELL").unwrap_or_else(|_| String::new()); - let mut profiles = Vec::new(); - // Always include `~/.profile` - profiles.push(home_dir.join(".profile")); + let mut profiles = vec![home_dir.join(".profile")]; // PROFILE environment variable, if set if let Ok(profile_env) = env::var("PROFILE") {