From 091379f01161213b29b8cdefb49a52ec20e02190 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sat, 22 Sep 2018 07:45:40 +1000 Subject: [PATCH] Replace `env::dir` with `dirs` crate --- Cargo.toml | 1 + lighthouse/config/mod.rs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ae9194004..bcd5fceb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ boolean-bitfield = { path = "boolean-bitfield" } bytes = "" crypto-mac = "^0.6.2" clap = "2.32.0" +dirs = "1.0.3" ethereum-types = "" futures = "0.1.23" network-libp2p = { path = "network-libp2p" } diff --git a/lighthouse/config/mod.rs b/lighthouse/config/mod.rs index 80350293d..42dd919e6 100644 --- a/lighthouse/config/mod.rs +++ b/lighthouse/config/mod.rs @@ -1,5 +1,7 @@ -use std::{ env, fs }; -use std::path::PathBuf; +extern crate dirs; + +use std::fs; +use std::path::PathBuf; /// Stores the core configuration for this Lighthouse instance. /// This struct is general, other components may implement more @@ -16,7 +18,7 @@ impl LighthouseConfig { /// Build a new lighthouse configuration from defaults. pub fn default() -> Self{ let data_dir = { - let home = env::home_dir() + let home = dirs::home_dir() .expect("Unable to determine home dir."); home.join(DEFAULT_LIGHTHOUSE_DIR) };