Skip to content

Commit 49cb62b

Browse files
Replace directories-next dependency with directories (#4661)
`directories-next` was created because `directories` was not maintained at the time. However, `directories` has gotten active maintainership since, and it has received more updates than `directories-next`. `directories` also has more recent downloads than its `next` counterpart, so it might make sense to switch to it, to avoid unnecessary duplicate dependencies, where a project depends transitively on both `directories` and `directories-next`. The main question is whether we depend on any specific behavior from `directories-next`.
1 parent ee3b04e commit 49cb62b

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

Cargo.lock

+16-10
Original file line numberDiff line numberDiff line change
@@ -1107,24 +1107,24 @@ dependencies = [
11071107
]
11081108

11091109
[[package]]
1110-
name = "directories-next"
1111-
version = "2.0.0"
1110+
name = "directories"
1111+
version = "5.0.1"
11121112
source = "registry+https://github.com/rust-lang/crates.io-index"
1113-
checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc"
1113+
checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35"
11141114
dependencies = [
1115-
"cfg-if",
1116-
"dirs-sys-next",
1115+
"dirs-sys",
11171116
]
11181117

11191118
[[package]]
1120-
name = "dirs-sys-next"
1121-
version = "0.1.2"
1119+
name = "dirs-sys"
1120+
version = "0.4.1"
11221121
source = "registry+https://github.com/rust-lang/crates.io-index"
1123-
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
1122+
checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
11241123
dependencies = [
11251124
"libc",
1125+
"option-ext",
11261126
"redox_users",
1127-
"winapi",
1127+
"windows-sys 0.48.0",
11281128
]
11291129

11301130
[[package]]
@@ -1175,7 +1175,7 @@ version = "0.27.2"
11751175
dependencies = [
11761176
"ahash",
11771177
"bytemuck",
1178-
"directories-next",
1178+
"directories",
11791179
"document-features",
11801180
"egui",
11811181
"egui-wgpu",
@@ -2669,6 +2669,12 @@ version = "11.1.3"
26692669
source = "registry+https://github.com/rust-lang/crates.io-index"
26702670
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
26712671

2672+
[[package]]
2673+
name = "option-ext"
2674+
version = "0.2.0"
2675+
source = "registry+https://github.com/rust-lang/crates.io-index"
2676+
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
2677+
26722678
[[package]]
26732679
name = "orbclient"
26742680
version = "0.3.46"

crates/eframe/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ glow = [
7070

7171
## Enable saving app state to disk.
7272
persistence = [
73-
"directories-next",
73+
"directories",
7474
"egui-winit/serde",
7575
"egui/persistence",
7676
"ron",
@@ -159,7 +159,7 @@ image = { workspace = true, features = ["png"] } # Needed for app icon
159159
winit = { workspace = true, default-features = false, features = ["rwh_06"] }
160160

161161
# optional native:
162-
directories-next = { version = "2", optional = true }
162+
directories = { version = "5", optional = true }
163163
egui-wgpu = { workspace = true, optional = true, features = [
164164
"winit",
165165
] } # if wgpu is used, use it with winit

crates/eframe/src/epi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ pub struct NativeOptions {
367367
pub persist_window: bool,
368368

369369
/// The folder where `eframe` will store the app state. If not set, eframe will get the paths
370-
/// from [directories_next].
370+
/// from [directories].
371371
pub persistence_path: Option<std::path::PathBuf>,
372372
}
373373

crates/eframe/src/native/file_storage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use std::{
1010
/// [`egui::ViewportBuilder::app_id`] of [`crate::NativeOptions::viewport`]
1111
/// or the title argument to [`crate::run_native`].
1212
///
13-
/// On native the path is picked using [`directories_next::ProjectDirs::data_dir`](https://docs.rs/directories-next/2.0.0/directories_next/struct.ProjectDirs.html#method.data_dir) which is:
13+
/// On native the path is picked using [`directories::ProjectDirs::data_dir`](https://docs.rs/directories/5.0.1/directories/struct.ProjectDirs.html#method.data_dir) which is:
1414
/// * Linux: `/home/UserName/.local/share/APP_ID`
1515
/// * macOS: `/Users/UserName/Library/Application Support/APP_ID`
1616
/// * Windows: `C:\Users\UserName\AppData\Roaming\APP_ID`
1717
pub fn storage_dir(app_id: &str) -> Option<PathBuf> {
18-
directories_next::ProjectDirs::from("", "", app_id)
18+
directories::ProjectDirs::from("", "", app_id)
1919
.map(|proj_dirs| proj_dirs.data_dir().to_path_buf())
2020
}
2121

deny.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ skip = [
5252
{ name = "libloading" }, # wgpu-hal itself depends on 0.8 while some of its dependencies, like ash and d3d12, depend on 0.7
5353
{ name = "memoffset" }, # tiny dependency
5454
{ name = "quick-xml" }, # old version via wayland-scanner
55-
{ name = "redox_syscall" }, # old version via directories-next
55+
{ name = "redox_syscall" }, # old version via winit
5656
{ name = "spin" }, # old version via ring through rusttls and other libraries, newer for wgpu.
5757
{ name = "time" }, # old version pulled in by unmaintianed crate 'chrono'
5858
{ name = "windows" }, # old version via accesskit_windows

0 commit comments

Comments
 (0)