Skip to content

Commit

Permalink
Use home crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Sep 24, 2019
1 parent bcad053 commit cdf3f62
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
37 changes: 27 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ edition = "2018"
[dependencies]
atty = "0.2"
error-chain = "0.12"
home = "0.5"
lazy_static = "1.0"
libc = "0.2.18"
rustc_version = "0.2"
Expand Down
6 changes: 2 additions & 4 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ pub fn run(target: &Target,
verbose: bool)
-> Result<ExitStatus> {
let root = root.path();
let home_dir = env::home_dir().ok_or_else(|| "couldn't get home directory. Is $HOME not set?")?;
let cargo_dir = env::var_os("CARGO_HOME")
.map(PathBuf::from)
.unwrap_or_else(|| home_dir.join(".cargo"));
let home_dir = home::home_dir().ok_or_else(|| "could not find home directory")?;
let cargo_dir = home::cargo_home()?;
let xargo_dir = env::var_os("XARGO_HOME")
.map(PathBuf::from)
.unwrap_or_else(|| home_dir.join(".xargo"));
Expand Down
6 changes: 5 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

use error_chain::error_chain;

error_chain!();
error_chain! {
foreign_links {
Io(std::io::Error);
}
}

0 comments on commit cdf3f62

Please sign in to comment.