summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordevzbysiu <50180524+devzbysiu@users.noreply.github.com>2020-12-09 01:31:10 +0100
committerGitHub <noreply@github.com>2020-12-09 00:31:10 +0000
commitc71e3f4e90b21bb48f5b67c5c62da165573ceec9 (patch)
tree40f326c74ce353ea39eb87acb45bbddd677bd68a
parentb45ed90542d1389a0cfad0cd22d5c50c7a717d2f (diff)
fix: Replace unmaintained dirs with dirs-next (#412)
* fix: Replace unmaintained dirs with dirs-next * fix: Fix compilation error on macos, remove warn Co-authored-by: Dan Davison <dandavison7@gmail.com>
-rw-r--r--Cargo.lock33
-rw-r--r--Cargo.toml2
-rw-r--r--src/bat_utils/dirs.rs5
3 files changed, 23 insertions, 17 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9e389cca..e5790102 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -78,7 +78,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea"
dependencies = [
"backtrace-sys",
- "cfg-if",
+ "cfg-if 0.1.9",
"libc",
"rustc-demangle",
]
@@ -169,6 +169,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
name = "chrono"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -230,7 +236,7 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.9",
]
[[package]]
@@ -239,24 +245,25 @@ version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.9",
"lazy_static",
]
[[package]]
-name = "dirs"
-version = "3.0.1"
+name = "dirs-next"
+version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff"
+checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
dependencies = [
- "dirs-sys",
+ "cfg-if 1.0.0",
+ "dirs-sys-next",
]
[[package]]
-name = "dirs-sys"
-version = "0.3.5"
+name = "dirs-sys-next"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a"
+checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d"
dependencies = [
"libc",
"redox_users",
@@ -312,7 +319,7 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad3c5233c9a940c8719031b423d7e6c16af66e031cb0420b0896f5245bf181d3"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.9",
"crc32fast",
"libc",
"miniz_oxide",
@@ -341,7 +348,7 @@ dependencies = [
"box_drawing",
"bytelines",
"console",
- "dirs",
+ "dirs-next",
"error-chain",
"git2",
"itertools",
@@ -493,7 +500,7 @@ version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
dependencies = [
- "cfg-if",
+ "cfg-if 0.1.9",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index ba290eaf..aada4cc2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ bitflags = "1.2.1"
box_drawing = "0.1.2"
bytelines = "2.2.2"
console = "0.13.0"
-dirs = "3.0"
+dirs-next = "2.0.0"
itertools = "0.9.0"
lazy_static = "1.4"
regex = "1.4.2"
diff --git a/src/bat_utils/dirs.rs b/src/bat_utils/dirs.rs
index eb3835a4..1706f10a 100644
--- a/src/bat_utils/dirs.rs
+++ b/src/bat_utils/dirs.rs
@@ -1,7 +1,6 @@
// Based on code from https://github.com/sharkdp/bat e981e974076a926a38f124b7d8746de2ca5f0a28
// See src/bat_utils/LICENSE
-use dirs as dirs_rs;
use lazy_static::lazy_static;
use std::path::{Path, PathBuf};
@@ -21,10 +20,10 @@ impl BatProjectDirs {
let cache_dir_op = env::var_os("XDG_CACHE_HOME")
.map(PathBuf::from)
.filter(|p| p.is_absolute())
- .or_else(|| dirs_rs::home_dir().map(|d| d.join(".cache")));
+ .or_else(|| dirs_next::home_dir().map(|d| d.join(".cache")));
#[cfg(not(target_os = "macos"))]
- let cache_dir_op = dirs_rs::cache_dir();
+ let cache_dir_op = dirs_next::cache_dir();
let cache_dir = cache_dir_op.map(|d| d.join("bat"))?;