mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 01:29:14 -05:00
Use dirs::home_dir
to replace deprecated std::env::home_dir
This commit is contained in:
parent
0185f9f9de
commit
c7a4ca3c88
2 changed files with 3 additions and 1 deletions
|
@ -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<DenoDir> {
|
||||
// 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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue