From 8f473227ac6192d6fb9da79e23fc2226b1abe7f7 Mon Sep 17 00:00:00 2001 From: Ygor Souza Date: Wed, 7 Aug 2024 19:21:02 +0200 Subject: [PATCH] Make Windows storage_dir match directories It was wrong in the documentation as well. --- crates/eframe/src/native/file_storage.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/native/file_storage.rs b/crates/eframe/src/native/file_storage.rs index 7a59028e5300..21da6982c1b7 100644 --- a/crates/eframe/src/native/file_storage.rs +++ b/crates/eframe/src/native/file_storage.rs @@ -15,7 +15,7 @@ use std::{ /// which is: /// * Linux: `/home/UserName/.local/share/APP_ID` /// * macOS: `/Users/UserName/Library/Application Support/APP_ID` -/// * Windows: `C:\Users\UserName\AppData\Roaming\APP_ID` +/// * Windows: `C:\Users\UserName\AppData\Roaming\APP_ID\data` /// /// If the `directories` feature is not enabled, it uses a naive approximation that returns the /// same result for the most common systems. @@ -59,7 +59,7 @@ fn naive_storage_dir(app_id: &str) -> Option { .join("Application Support") .join(app_id.replace(|c: char| c.is_ascii_whitespace(), "-")) }), - OS::Windows => var_os("APPDATA").map(|s| PathBuf::from(s).join(app_id)), + OS::Windows => var_os("APPDATA").map(|s| PathBuf::from(s).join(app_id).join("data")), OS::Unknown | OS::Android | OS::IOS => None, } }