From c7a4ca3c88850b6409888038aee7792087f081d8 Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Thu, 13 Sep 2018 23:04:02 -0700 Subject: Use `dirs::home_dir` to replace deprecated `std::env::home_dir` --- src/deno_dir.rs | 3 ++- src/main.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/deno_dir.rs b/src/deno_dir.rs index 53fbf5ba8..cdebf05c3 100644 --- a/src/deno_dir.rs +++ b/src/deno_dir.rs @@ -1,4 +1,5 @@ // Copyright 2018 the Deno authors. All rights reserved. MIT license. +use dirs; use errors::DenoError; use errors::DenoResult; use errors::ErrorKind; @@ -39,7 +40,7 @@ impl DenoDir { custom_root: Option<&Path>, ) -> std::io::Result { // Only setup once. - let home_dir = std::env::home_dir().expect("Could not get home directory."); + let home_dir = dirs::home_dir().expect("Could not get home directory."); let default = home_dir.join(".deno"); let root: PathBuf = match custom_root { diff --git a/src/main.rs b/src/main.rs index 12179ac6e..72bbe54fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ extern crate tokio; extern crate url; #[macro_use] extern crate log; +extern crate dirs; extern crate hyper_rustls; extern crate remove_dir_all; extern crate ring; -- cgit v1.2.3