From 66cc4e14ad26989fe404977a04fc03ec96b191fe Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Mon, 20 Aug 2018 13:45:45 -0700 Subject: [PATCH] Post: use dirs crate, avoiding compile warning about home_dir --- tools/cli/Cargo.toml | 1 + tools/cli/src/mentat_cli/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/cli/Cargo.toml b/tools/cli/Cargo.toml index e445570e..2bdd3eac 100644 --- a/tools/cli/Cargo.toml +++ b/tools/cli/Cargo.toml @@ -20,6 +20,7 @@ test = false [dependencies] combine = "2.2.2" +dirs = "1.0.3" env_logger = "0.5" failure = "0.1.1" failure_derive = "0.1.1" diff --git a/tools/cli/src/mentat_cli/lib.rs b/tools/cli/src/mentat_cli/lib.rs index 40f74012..e7744759 100644 --- a/tools/cli/src/mentat_cli/lib.rs +++ b/tools/cli/src/mentat_cli/lib.rs @@ -20,6 +20,7 @@ use std::path::{ extern crate combine; extern crate env_logger; +extern crate dirs; extern crate failure; extern crate getopts; 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, /// node_repl, python, and sqlite, at least. 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 }