diff --git a/Cargo.lock b/Cargo.lock index 118c2db..7f23de8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -510,15 +510,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] - [[package]] name = "http" version = "0.2.9" @@ -752,17 +743,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if 1.0.0", - "libc", -] - [[package]] name = "nix4vscode" version = "0.1.0" @@ -779,7 +759,6 @@ dependencies = [ "semver", "serde", "serde_json", - "standard_paths", "tokio", "toml", "tracing", @@ -1265,17 +1244,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "standard_paths" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f10ebae9a59d899e618eb7248d02077e656f1150ce125e3b5b98426c3b307" -dependencies = [ - "home", - "nix", - "winapi", -] - [[package]] name = "strsim" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 7151055..d57df31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,4 +20,3 @@ futures = "0.3.28" anyhow = "1.0.75" nixpkgs-fmt = "1.3.0" redb = "1.1.0" -standard_paths = "2.1.0" diff --git a/src/utils.rs b/src/utils.rs index c6d5599..b18f26d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,12 +1,15 @@ +use std::path::PathBuf; + use redb::{ReadableTable, TableDefinition}; -use standard_paths::{LocationType, StandardPaths}; pub static CACHER: std::sync::LazyLock = std::sync::LazyLock::new(|| { - let path = StandardPaths::new("nix4vscode", "cathaysia"); - let path = path - .writable_location(LocationType::GenericCacheLocation) - .unwrap(); - let path = path.join("nix4vscode"); + let path = format!( + "{}/{}/{}", + std::env::var("HOME").unwrap(), + ".cache", + "nix4vscode" + ); + let path = PathBuf::from(path); if !path.exists() { std::fs::create_dir_all(path.clone()).unwrap(); }