Replace std::env::home_dir() with home crate impl. (#9293)
* Import the `home` crate in `util/dir`.
* Replace uses of `env::home_dir()` with `home::home_dir()`.
* `home` uses a 'correct' impl. on windows and the stdlib impl.
of `::home_dir` otherwise.
* Reexport `home::home_dir` from `util/dir`.
* Bump `util/dir` to 0.1.2.
This commit is contained in:
@@ -19,11 +19,10 @@
|
||||
use semver::{Version, SemVerError};
|
||||
use std::collections::*;
|
||||
use std::fs::{self, File, create_dir_all};
|
||||
use std::env;
|
||||
use std::io;
|
||||
use std::io::{Read, Write};
|
||||
use std::path::{PathBuf, Path};
|
||||
use dir::{DatabaseDirectories, default_data_path};
|
||||
use dir::{DatabaseDirectories, default_data_path, home_dir};
|
||||
use dir::helpers::replace_home;
|
||||
use journaldb::Algorithm;
|
||||
|
||||
@@ -201,7 +200,7 @@ fn upgrade_user_defaults(dirs: &DatabaseDirectories) {
|
||||
}
|
||||
|
||||
pub fn upgrade_data_paths(base_path: &str, dirs: &DatabaseDirectories, pruning: Algorithm) {
|
||||
if env::home_dir().is_none() {
|
||||
if home_dir().is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user