Skip to content

Commit

Permalink
Switch from dirs-next to dirs and release a new version
Browse files Browse the repository at this point in the history
`dirs-next` is now the abandoned crate, so switch to `dirs`.
  • Loading branch information
mrobinson committed Jul 18, 2024
1 parent 3c08472 commit 81d858e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "font-kit"
version = "0.13.2"
version = "0.13.3"
authors = ["Patrick Walton <[email protected]>"]
description = "A cross-platform font loading library"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -62,7 +62,7 @@ freetype-sys = "0.20"
yeslogic-fontconfig-sys = "5.0"

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

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
walkdir = "2.1"
8 changes: 4 additions & 4 deletions src/sources/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::path::{Path, PathBuf};
use walkdir::WalkDir;

#[cfg(not(any(target_os = "android", target_family = "windows", target_env = "ohos")))]
use dirs_next;
use dirs;
#[cfg(target_family = "windows")]
use std::ffi::OsString;
#[cfg(target_family = "windows")]
Expand Down Expand Up @@ -203,7 +203,7 @@ fn default_font_directories() -> Vec<PathBuf> {
PathBuf::from("/Library/Fonts"),
PathBuf::from("/Network/Library/Fonts"),
];
if let Some(mut path) = dirs_next::home_dir() {
if let Some(mut path) = dirs::home_dir() {
path.push("Library");
path.push("Fonts");
directories.push(path);
Expand All @@ -224,11 +224,11 @@ fn default_font_directories() -> Vec<PathBuf> {
PathBuf::from("/var/run/host/usr/share/fonts"), // Flatpak specific
PathBuf::from("/var/run/host/usr/local/share/fonts"),
];
if let Some(path) = dirs_next::home_dir() {
if let Some(path) = dirs::home_dir() {
directories.push(path.join(".fonts")); // ~/.fonts is deprecated
directories.push(path.join("local").join("share").join("fonts")); // Flatpak specific
}
if let Some(mut path) = dirs_next::data_dir() {
if let Some(mut path) = dirs::data_dir() {
path.push("fonts");
directories.push(path);
}
Expand Down

0 comments on commit 81d858e

Please sign in to comment.