Skip to content

Commit

Permalink
alice-open-data: Replace deprecated env::home_dir with dirs crate
Browse files Browse the repository at this point in the history
  • Loading branch information
akubera committed Dec 20, 2018
1 parent 7d2a48e commit 450a7f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions alice-open-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ license = "MPL-2.0"
glob = "^0.2.11"
failure = "0.1.1"
reqwest = "0.8.5"
dirs = "1.0"
4 changes: 2 additions & 2 deletions alice-open-data/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[macro_use]
extern crate failure;
extern crate dirs;
extern crate glob;
extern crate reqwest;

use std::env;
use std::io::{Read};
use std::path::PathBuf;
use std::fs::{DirBuilder, File};
Expand Down Expand Up @@ -36,7 +36,7 @@ pub fn download(base_dir: PathBuf, url: Url) -> Result<u64, Error> {

/// Base path to the local ALICE open data directory
pub fn data_dir() -> Result<PathBuf, Error> {
let mut dir = env::home_dir().ok_or(format_err!("No home directory"))?;
let mut dir = dirs::home_dir().ok_or(format_err!("No home directory"))?;
dir.push("lhc_open_data");
Ok(dir)
}
Expand Down

0 comments on commit 450a7f1

Please sign in to comment.