Post: use dirs crate, avoiding compile warning about home_dir
This commit is contained in:
parent
22b17a6779
commit
66cc4e14ad
2 changed files with 3 additions and 1 deletions
|
@ -20,6 +20,7 @@ test = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
combine = "2.2.2"
|
combine = "2.2.2"
|
||||||
|
dirs = "1.0.3"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
failure = "0.1.1"
|
failure = "0.1.1"
|
||||||
failure_derive = "0.1.1"
|
failure_derive = "0.1.1"
|
||||||
|
|
|
@ -20,6 +20,7 @@ use std::path::{
|
||||||
|
|
||||||
extern crate combine;
|
extern crate combine;
|
||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
|
extern crate dirs;
|
||||||
extern crate failure;
|
extern crate failure;
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
extern crate linefeed;
|
extern crate linefeed;
|
||||||
|
@ -46,7 +47,7 @@ static HISTORY_FILE_PATH: &str = ".mentat_history";
|
||||||
/// This accords with main other tools which prefix with "." and suffix with "_history": lein,
|
/// This accords with main other tools which prefix with "." and suffix with "_history": lein,
|
||||||
/// node_repl, python, and sqlite, at least.
|
/// node_repl, python, and sqlite, at least.
|
||||||
pub(crate) fn history_file_path() -> PathBuf {
|
pub(crate) fn history_file_path() -> PathBuf {
|
||||||
let mut p = ::std::env::home_dir().unwrap_or_default();
|
let mut p = dirs::home_dir().unwrap_or_default();
|
||||||
p.push(::HISTORY_FILE_PATH);
|
p.push(::HISTORY_FILE_PATH);
|
||||||
p
|
p
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue