Skip to content

Commit 5742fb3

Browse files
committed
Switch from dirs-next to dirs and release a new version
`dirs-next` is now the abandoned crate, so switch to `dirs`.
1 parent dbfe444 commit 5742fb3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "font-kit"
3-
version = "0.14.0"
3+
version = "0.14.1"
44
authors = ["Patrick Walton <pcwalton@mimiga.net>"]
55
description = "A cross-platform font loading library"
66
license = "MIT OR Apache-2.0"
@@ -63,7 +63,7 @@ freetype-sys = "0.20"
6363
yeslogic-fontconfig-sys = "6.0"
6464

6565
[target.'cfg(not(any(target_arch = "wasm32", target_family = "windows", target_os = "android", target_env = "ohos")))'.dependencies]
66-
dirs-next = "2.0"
66+
dirs = "5.0"
6767

6868
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
6969
walkdir = "2.1"

src/sources/fs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::path::{Path, PathBuf};
2020
use walkdir::WalkDir;
2121

2222
#[cfg(not(any(target_os = "android", target_family = "windows", target_env = "ohos")))]
23-
use dirs_next;
23+
use dirs;
2424
#[cfg(target_family = "windows")]
2525
use std::ffi::OsString;
2626
#[cfg(target_family = "windows")]
@@ -203,7 +203,7 @@ fn default_font_directories() -> Vec<PathBuf> {
203203
PathBuf::from("/Library/Fonts"),
204204
PathBuf::from("/Network/Library/Fonts"),
205205
];
206-
if let Some(mut path) = dirs_next::home_dir() {
206+
if let Some(mut path) = dirs::home_dir() {
207207
path.push("Library");
208208
path.push("Fonts");
209209
directories.push(path);
@@ -224,11 +224,11 @@ fn default_font_directories() -> Vec<PathBuf> {
224224
PathBuf::from("/var/run/host/usr/share/fonts"), // Flatpak specific
225225
PathBuf::from("/var/run/host/usr/local/share/fonts"),
226226
];
227-
if let Some(path) = dirs_next::home_dir() {
227+
if let Some(path) = dirs::home_dir() {
228228
directories.push(path.join(".fonts")); // ~/.fonts is deprecated
229229
directories.push(path.join("local").join("share").join("fonts")); // Flatpak specific
230230
}
231-
if let Some(mut path) = dirs_next::data_dir() {
231+
if let Some(mut path) = dirs::data_dir() {
232232
path.push("fonts");
233233
directories.push(path);
234234
}

0 commit comments

Comments
 (0)