From ecac0d54aac305576c1d63ff6c973cd883fb8925 Mon Sep 17 00:00:00 2001 From: futile Date: Wed, 30 Apr 2025 00:53:27 +0100 Subject: [PATCH] eliminate `dirs` dependency by checking `LOCALAPPDATA` envvar instead --- Cargo.lock | 71 ++++------------------------------------------ Cargo.toml | 1 - src/util/consts.rs | 4 +-- 3 files changed, 8 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d7daa9..32bc98d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ "ndk-context", "ndk-sys", "num_enum", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -204,7 +204,7 @@ dependencies = [ "polling", "rustix", "slab", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -421,27 +421,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.59.0", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -868,7 +847,6 @@ version = "0.5.3" dependencies = [ "catppuccin-egui", "chrono", - "dirs", "eframe", "egui_extras", "image", @@ -1157,7 +1135,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror 1.0.69", + "thiserror", "walkdir", "windows-sys 0.45.0", ] @@ -1316,7 +1294,7 @@ dependencies = [ "ndk-sys", "num_enum", "raw-window-handle", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -1672,12 +1650,6 @@ dependencies = [ "pathdiff", ] -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "orbclient" version = "0.3.48" @@ -1881,17 +1853,6 @@ dependencies = [ "bitflags 2.9.0", ] -[[package]] -name = "redox_users" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 2.0.12", -] - [[package]] name = "resvg" version = "0.37.0" @@ -2134,7 +2095,7 @@ dependencies = [ "log", "memmap2", "rustix", - "thiserror 1.0.69", + "thiserror", "wayland-backend", "wayland-client", "wayland-csd-frame", @@ -2270,16 +2231,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" -dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl", ] [[package]] @@ -2293,17 +2245,6 @@ dependencies = [ "syn", ] -[[package]] -name = "thiserror-impl" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tiff" version = "0.9.1" diff --git a/Cargo.toml b/Cargo.toml index b557585..076e1ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ catppuccin-egui = { version = "5.5.0", default-features = false, features = [ "egui31", ] } chrono = { version = "0.4.40", default-features = false, features = ["clock"] } -dirs = "6.0.0" eframe = { version = "0.31.1", default-features = false, features = [ "glow", "default_fonts", diff --git a/src/util/consts.rs b/src/util/consts.rs index d50ef32..5371f5d 100644 --- a/src/util/consts.rs +++ b/src/util/consts.rs @@ -1,7 +1,7 @@ -use std::{path::PathBuf, sync::LazyLock}; +use std::{env, path::PathBuf, sync::LazyLock}; pub static APP_STORAGE_PATH: LazyLock = - LazyLock::new(|| dirs::config_local_dir().unwrap().join("GTA Tools")); + LazyLock::new(|| PathBuf::from(env::var("LOCALAPPDATA").unwrap()).join("GTA Tools")); pub mod game { pub const EXE_ENHANCED: &str = "GTA5_Enhanced.exe";