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", "processthreadsapi",
"regexes", "regexes",
"rsplitn", "rsplitn",
"runlevel",
"rustfmt", "rustfmt",
"shilangyu", "shilangyu",
"softirq", "softirq",
@ -93,6 +94,7 @@
"sysinfo", "sysinfo",
"tebibyte", "tebibyte",
"tokei", "tokei",
"trung",
"twrite", "twrite",
"usage", "usage",
"use", "use",

67
Cargo.lock generated
View File

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

View File

@ -31,7 +31,7 @@ chrono = "0.4.19"
crossterm = "0.17" crossterm = "0.17"
ctrlc = {version = "3.1", features = ["termination"]} ctrlc = {version = "3.1", features = ["termination"]}
clap = "2.33" clap = "2.33"
dirs = "3.0.1" dirs-next = "2.0.0"
futures = "0.3.5" futures = "0.3.5"
indexmap = "1.6.0" indexmap = "1.6.0"
itertools = "0.9.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 { let config_path = if let Some(conf_loc) = config_location {
Some(PathBuf::from(conf_loc)) Some(PathBuf::from(conf_loc))
} else if cfg!(target_os = "windows") { } 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; let mut path = home_path;
path.push(DEFAULT_CONFIG_FILE_PATH); path.push(DEFAULT_CONFIG_FILE_PATH);
Some(path) Some(path)
} else { } else {
None 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; let mut path = home_path;
path.push(".config/"); path.push(".config/");
path.push(DEFAULT_CONFIG_FILE_PATH); path.push(DEFAULT_CONFIG_FILE_PATH);
@ -200,7 +200,7 @@ pub fn read_config(config_location: Option<&str>) -> error::Result<Option<PathBu
Some(path) Some(path)
} else { } else {
// If it does not, use the new one! // 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; let mut path = config_path;
path.push(DEFAULT_CONFIG_FILE_PATH); path.push(DEFAULT_CONFIG_FILE_PATH);
Some(path) Some(path)