From 8775196be88f706bca773c632fa8ce0a61c2d635 Mon Sep 17 00:00:00 2001 From: Dax Huiberts Date: Thu, 17 Oct 2024 16:45:23 +0200 Subject: [PATCH] book: Make listings work on macos by using glib user_data_dir --- book/listings/xtask/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/book/listings/xtask/main.rs b/book/listings/xtask/main.rs index 23a6bdfb2118..678cf4cedc7c 100644 --- a/book/listings/xtask/main.rs +++ b/book/listings/xtask/main.rs @@ -1,7 +1,6 @@ use std::env; use std::path::PathBuf; -use anyhow::Context; use walkdir::WalkDir; use xshell::{cmd, Shell}; @@ -53,9 +52,7 @@ fn schema_dir() -> anyhow::Result { let schema_dir = if cfg!(windows) { PathBuf::from("C:/ProgramData/glib-2.0/schemas/") } else { - dirs::data_dir() - .context("Could not get data dir")? - .join("glib-2.0/schemas") + gtk::glib::user_data_dir().join("glib-2.0/schemas") }; Ok(schema_dir) }