Skip to content

Instantly share code, notes, and snippets.

@lorenzocorallo
lorenzocorallo / main.rs
Created April 1, 2023 15:55
Tauri - Global variable (Mutex) containing custom app data dir
use std::sync::Mutex;
use tauri::api::path::data_dir;
pub static APP_DATA_DIR: Mutex<String> = Mutex::new(String::new());
fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![])
.setup(|app| {
let sys_data_dir = data_dir().unwrap();