Switch to dirs-next

This commit is contained in:
Michael Vines
2020-10-31 09:09:17 -07:00
committed by mergify[bot]
parent 39120b3343
commit e872715fd6
10 changed files with 61 additions and 56 deletions

View File

@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
bs58 = "0.3.1"
clap = "2.33"
dirs = "2.0.2"
dirs-next = "2.0.0"
num_cpus = "1.13.0"
solana-clap-utils = { path = "../clap-utils", version = "1.5.0" }
solana-cli-config = { path = "../cli-config", version = "1.5.0" }

View File

@ -52,7 +52,7 @@ fn get_keypair_from_matches(
config: Config,
wallet_manager: &mut Option<Arc<RemoteWalletManager>>,
) -> Result<Box<dyn Signer>, Box<dyn error::Error>> {
let mut path = dirs::home_dir().expect("home directory");
let mut path = dirs_next::home_dir().expect("home directory");
let path = if matches.is_present("keypair") {
matches.value_of("keypair").unwrap()
} else if config.keypair_path != "" {
@ -421,7 +421,7 @@ fn do_main(matches: &ArgMatches<'_>) -> Result<(), Box<dyn error::Error>> {
}
}
("new", Some(matches)) => {
let mut path = dirs::home_dir().expect("home directory");
let mut path = dirs_next::home_dir().expect("home directory");
let outfile = if matches.is_present("outfile") {
matches.value_of("outfile")
} else if matches.is_present("no_outfile") {
@ -478,7 +478,7 @@ fn do_main(matches: &ArgMatches<'_>) -> Result<(), Box<dyn error::Error>> {
}
}
("recover", Some(matches)) => {
let mut path = dirs::home_dir().expect("home directory");
let mut path = dirs_next::home_dir().expect("home directory");
let outfile = if matches.is_present("outfile") {
matches.value_of("outfile").unwrap()
} else {