Replace dirs with dirs-next

This commit is contained in:
brightly-salty
2020-12-15 06:59:26 -06:00
parent 7bde174b40
commit 4854da4805
4 changed files with 28 additions and 17 deletions

35
Cargo.lock generated
View File

@@ -265,16 +265,6 @@ dependencies = [
"generic-array", "generic-array",
] ]
[[package]]
name = "dirs"
version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
dependencies = [
"cfg-if 0.1.10",
"dirs-sys",
]
[[package]] [[package]]
name = "dirs" name = "dirs"
version = "3.0.1" version = "3.0.1"
@@ -284,6 +274,16 @@ dependencies = [
"dirs-sys", "dirs-sys",
] ]
[[package]]
name = "dirs-next"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
dependencies = [
"cfg-if 1.0.0",
"dirs-sys-next",
]
[[package]] [[package]]
name = "dirs-sys" name = "dirs-sys"
version = "0.3.5" version = "0.3.5"
@@ -295,6 +295,17 @@ dependencies = [
"winapi 0.3.8", "winapi 0.3.8",
] ]
[[package]]
name = "dirs-sys-next"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d"
dependencies = [
"libc",
"redox_users",
"winapi 0.3.8",
]
[[package]] [[package]]
name = "divrem" name = "divrem"
version = "0.1.0" version = "0.1.0"
@@ -1220,7 +1231,7 @@ checksum = "1a5f54deba50e65ee4cf786dbc37e8b3c63bdccccbcf9d3a8a9fd0c1bb7e1984"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if 1.0.0", "cfg-if 1.0.0",
"dirs 3.0.1", "dirs",
"fs2", "fs2",
"libc", "libc",
"log", "log",
@@ -1264,7 +1275,7 @@ dependencies = [
"chrono", "chrono",
"cpu-time", "cpu-time",
"crossterm", "crossterm",
"dirs 2.0.2", "dirs-next",
"divrem", "divrem",
"downcast", "downcast",
"git-version", "git-version",

View File

@@ -21,7 +21,7 @@ num = ["num-rug-adapter", "prolog_parser/num"]
[dependencies] [dependencies]
cpu-time = "1.0.0" cpu-time = "1.0.0"
crossterm = "0.16.0" crossterm = "0.16.0"
dirs = "2.0.2" dirs-next = "2.0.0"
divrem = "0.1.0" divrem = "0.1.0"
downcast = "0.10.0" downcast = "0.10.0"
git-version = "0.3.4" git-version = "0.3.4"

View File

@@ -281,7 +281,7 @@ impl Machine {
} }
fn compile_scryerrc(&mut self) { fn compile_scryerrc(&mut self) {
let mut path = match dirs::home_dir() { let mut path = match dirs_next::home_dir() {
Some(path) => path, Some(path) => path,
None => return, None => return,
}; };

View File

@@ -47,7 +47,7 @@ pub mod readline {
#[inline] #[inline]
pub fn new(pending_input: String) -> Self { pub fn new(pending_input: String) -> Self {
let mut rl = Editor::<()>::new(); let mut rl = Editor::<()>::new();
if let Some(mut path) = dirs::home_dir() { if let Some(mut path) = dirs_next::home_dir() {
path.push(HISTORY_FILE); path.push(HISTORY_FILE);
if path.exists() { if path.exists() {
if rl.load_history(&path).is_err() { if rl.load_history(&path).is_err() {
@@ -95,7 +95,7 @@ pub mod readline {
} }
fn save_history(&mut self) { fn save_history(&mut self) {
if let Some(mut path) = dirs::home_dir() { if let Some(mut path) = dirs_next::home_dir() {
path.push(HISTORY_FILE); path.push(HISTORY_FILE);
if path.exists() { if path.exists() {
if self.rl.append_history(&path).is_err() { if self.rl.append_history(&path).is_err() {