Skip to content

Commit

Permalink
chore(deps): Replace dirs_2 with dirs.
Browse files Browse the repository at this point in the history
The old one is not updated in four years and it depends on the
unmaintained failure crate.

It still compiles, the breaking changes seem irrelevant.
  • Loading branch information
DanielVoogsgerd committed Oct 3, 2024
1 parent 30e8c50 commit c3aea42
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 136 deletions.
155 changes: 26 additions & 129 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion brane-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ chrono = "0.4.35"
clap = { version = "4.5.6", features = ["derive","env"] }
console = "0.15.5"
dialoguer = "0.11.0"
dirs-2 = "3.0.1"
dirs = "5.0.1"
dotenvy = "0.15.0"
enum-debug = { git = "https://github.com/Lut99/enum-debug", tag = "v1.0.0", features = ["derive"] }
error-trace = { git = "https://github.com/Lut99/error-trace-rs", tag = "v2.0.0" }
Expand Down
6 changes: 3 additions & 3 deletions brane-cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ pub fn determine_kind(path: &Path) -> Result<PackageKind, UtilError> {



/// **Edited: uses dirs_2 instead of appdirs and returns UtilErrors when it goes wrong.**
/// **Edited: uses dirs instead of appdirs and returns UtilErrors when it goes wrong.**
///
/// Returns the path of the configuration directory. Is guaranteed to be an absolute path when it returns successfully (but _not_ that it also exists!).
///
/// **Returns**
/// The path of the Brane configuration directory if successful, or a UtilError otherwise.
pub fn get_config_dir() -> Result<PathBuf, UtilError> {
// Try to get the user directory
let user = match dirs_2::config_dir() {
let user = match dirs::config_dir() {
Some(user) => user,
None => {
return Err(UtilError::UserConfigDirNotFound);
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn ensure_history_file(create: bool) -> Result<PathBuf, UtilError> {
/// A PathBuf with the absolute path that is guaranteed to exist, or an UtilError otherwise.
pub fn get_data_dir() -> Result<PathBuf, UtilError> {
// Try to get the user directory
let user = match dirs_2::data_local_dir() {
let user = match dirs::data_local_dir() {
Some(user) => user,
None => {
return Err(UtilError::UserLocalDataDirNotFound);
Expand Down
2 changes: 1 addition & 1 deletion brane-ctl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ console = "0.15.5"
dialoguer = "0.11.0"
diesel = { version = "2.1.0", features = ["sqlite"] }
diesel_migrations = "2.1.0"
dirs-2 = "3.0.0"
dirs = "5.0.0"
dotenvy = "0.15.0"
eflint-to-json = { git = "https://github.com/epi-project/policy-reasoner" }
enum-debug = { git = "https://github.com/Lut99/enum-debug", tag = "v1.0.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion brane-ctl/src/wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use brane_cfg::node::{self, NodeConfig, NodeKind, NodeSpecificConfig};
use brane_cfg::proxy::{ForwardConfig, ProxyConfig, ProxyProtocol};
use brane_shr::input::{confirm, input, input_map, input_path, select, FileHistory};
use console::style;
use dirs_2::config_dir;
use dirs::config_dir;
use enum_debug::EnumDebug as _;
use log::{debug, info};
use specifications::address::Address;
Expand Down
1 change: 0 additions & 1 deletion brane-tsk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ specifications = { path = "../specifications" }

[dev-dependencies]
clap = { version = "4.4.0", features = ["derive"] }
dirs-2 = "3.0.0"
humanlog = { git = "https://github.com/Lut99/humanlog-rs", tag = "v0.1.0" }
lazy_static = "1.4.0"

Expand Down

0 comments on commit c3aea42

Please sign in to comment.