Skip to content

Commit e2ddaa7

Browse files
author
brightly-salty
committed
Replace dirs with dirs-next
1 parent da337c4 commit e2ddaa7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ freetype = "0.7"
6161
servo-fontconfig = "0.5"
6262

6363
[target.'cfg(not(any(target_arch = "wasm32", target_family = "windows", target_os = "android")))'.dependencies]
64-
dirs = "2.0"
64+
dirs-next = "2.0"
6565

6666
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
6767
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::PathBuf;
2020
use walkdir::WalkDir;
2121

2222
#[cfg(not(any(target_os = "android", target_family = "windows")))]
23-
use dirs;
23+
use dirs_next;
2424
#[cfg(target_family = "windows")]
2525
use std::ffi::OsString;
2626
#[cfg(target_family = "windows")]
@@ -180,7 +180,7 @@ fn default_font_directories() -> Vec<PathBuf> {
180180
PathBuf::from("/Library/Fonts"),
181181
PathBuf::from("/Network/Library/Fonts"),
182182
];
183-
if let Some(mut path) = dirs::home_dir() {
183+
if let Some(mut path) = dirs_next::home_dir() {
184184
path.push("Library");
185185
path.push("Fonts");
186186
directories.push(path);
@@ -196,11 +196,11 @@ fn default_font_directories() -> Vec<PathBuf> {
196196
PathBuf::from("/var/run/host/usr/share/fonts"), // Flatpak specific
197197
PathBuf::from("/var/run/host/usr/local/share/fonts"),
198198
];
199-
if let Some(path) = dirs::home_dir() {
199+
if let Some(path) = dirs_next::home_dir() {
200200
directories.push(path.join(".fonts")); // ~/.fonts is deprecated
201201
directories.push(path.join("local").join("share").join("fonts")); // Flatpak specific
202202
}
203-
if let Some(mut path) = dirs::data_dir() {
203+
if let Some(mut path) = dirs_next::data_dir() {
204204
path.push("fonts");
205205
directories.push(path);
206206
}

0 commit comments

Comments
 (0)