deps: switch from dirs to dirs-next (#285)

Addresses RUSTSEC-2020-0053.
This commit is contained in:
Clement Tsang 2020-11-01 22:03:29 -05:00 committed by GitHub
parent 7e16e3467b
commit 309ebd8dc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 34 deletions

View file

@ -82,6 +82,7 @@
"processthreadsapi",
"regexes",
"rsplitn",
"runlevel",
"rustfmt",
"shilangyu",
"softirq",
@ -93,6 +94,7 @@
"sysinfo",
"tebibyte",
"tokei",
"trung",
"twrite",
"usage",
"use",

67
Cargo.lock generated
View file

@ -88,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0df2f85c8a2abbe3b7d7e748052fdd9b76a0458fdeb16ad4223f5eca78c7c130"
dependencies = [
"addr2line",
"cfg-if",
"cfg-if 0.1.10",
"libc",
"object",
"rustc-demangle",
@ -106,7 +106,7 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8775be4956c98c9ac7c11cc383d632636935d3a688dabddb71ac83ba00a3a72f"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"core-foundation",
"lazycell",
"libc",
@ -146,7 +146,7 @@ dependencies = [
"clap",
"crossterm",
"ctrlc",
"dirs",
"dirs-next",
"fern",
"futures",
"heim",
@ -192,6 +192,12 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[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.19"
@ -269,7 +275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
dependencies = [
"autocfg",
"cfg-if",
"cfg-if 0.1.10",
"crossbeam-utils",
"lazy_static",
"maybe-uninit",
@ -283,7 +289,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"crossbeam-utils",
]
@ -294,7 +300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
dependencies = [
"autocfg",
"cfg-if",
"cfg-if 0.1.10",
"lazy_static",
]
@ -360,19 +366,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
[[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",
@ -526,7 +533,7 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"libc",
"wasi",
]
@ -567,7 +574,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "144af2a423102dd4dd3e9fdd2c77c4756fb3c6c009d691628997fd5a2247719a"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"core-foundation",
"futures-core",
"futures-util",
@ -586,7 +593,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8abb50616d331bd75cd7f52d56b66114a0e8813fda2201c3618a105baa2b470d"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
"lazy_static",
@ -602,7 +609,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49e5740e687a7e1f1db597e14aff112b076f48997fe617b9b165e7c2f139d248"
dependencies = [
"bitflags",
"cfg-if",
"cfg-if 0.1.10",
"core-foundation",
"heim-common",
"heim-runtime",
@ -618,7 +625,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d46019db89b0021344fd5bb8626a12cb5d9556aa8b79685ecc907b0c43e3c5f0"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
"lazy_static",
@ -634,7 +641,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "216b66fececba2f68a08d15b893f0c5826346b5fb4c8d5201494f8ac2347d3bf"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
"lazy_static",
@ -650,7 +657,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52b790922244bd5b139254a0411ea2b4e4175b3e4c261d52011a9c42535c7aa7"
dependencies = [
"bitflags",
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
"hex",
@ -665,7 +672,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c8e29fca8becea6bc261c38230f3f45a358b7922451353dd068247a3ef059de"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"darwin-libproc",
"heim-common",
"heim-cpu",
@ -687,7 +694,7 @@ version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00bd0a5a5e4af50d5d7d9537d3ecf02dca42c26bbbd8dd76621c5116dab14f69"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"futures-channel",
"heim-common",
"lazy_static",
@ -700,7 +707,7 @@ version = "0.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f1250df4d79d4238261588e5aaf1de0e7853dbe632f5bd6868e394d1e730024"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
]
@ -711,7 +718,7 @@ version = "0.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4b6ac6721ba5856659a197934ce522250a3ddd2e8646daa5660b41f1ba96457"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"heim-common",
"heim-runtime",
"raw-cpuid",
@ -803,7 +810,7 @@ version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
]
[[package]]
@ -848,7 +855,7 @@ version = "0.6.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
@ -879,7 +886,7 @@ version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"libc",
"winapi 0.3.9",
]
@ -892,7 +899,7 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363"
dependencies = [
"bitflags",
"cc",
"cfg-if",
"cfg-if 0.1.10",
"libc",
"void",
]
@ -989,7 +996,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"cloudabi",
"libc",
"redox_syscall",
@ -1282,7 +1289,7 @@ version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67330cbee3b2a819e3365a773f05e884a136603687f812bf24db5b6c3d76b696"
dependencies = [
"cfg-if",
"cfg-if 0.1.10",
"doc-comment",
"libc",
"ntapi",

View file

@ -31,7 +31,7 @@ chrono = "0.4.19"
crossterm = "0.17"
ctrlc = {version = "3.1", features = ["termination"]}
clap = "2.33"
dirs = "3.0.1"
dirs-next = "2.0.0"
futures = "0.3.5"
indexmap = "1.6.0"
itertools = "0.9.0"

View file

@ -184,14 +184,14 @@ pub fn read_config(config_location: Option<&str>) -> error::Result<Option<PathBu
let config_path = if let Some(conf_loc) = config_location {
Some(PathBuf::from(conf_loc))
} else if cfg!(target_os = "windows") {
if let Some(home_path) = dirs::config_dir() {
if let Some(home_path) = dirs_next::config_dir() {
let mut path = home_path;
path.push(DEFAULT_CONFIG_FILE_PATH);
Some(path)
} else {
None
}
} else if let Some(home_path) = dirs::home_dir() {
} else if let Some(home_path) = dirs_next::home_dir() {
let mut path = home_path;
path.push(".config/");
path.push(DEFAULT_CONFIG_FILE_PATH);
@ -200,7 +200,7 @@ pub fn read_config(config_location: Option<&str>) -> error::Result<Option<PathBu
Some(path)
} else {
// If it does not, use the new one!
if let Some(config_path) = dirs::config_dir() {
if let Some(config_path) = dirs_next::config_dir() {
let mut path = config_path;
path.push(DEFAULT_CONFIG_FILE_PATH);
Some(path)