You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really these could just be the global statics rather than state. There's a lazy static macro in use but OnceLock is also in the standard library now, which could initialise the global.
Which instead would look like:
pubstaticARK_SHELF_WORKING_DIR:OnceLock<PathBuf> = OnceLock::new();pubstaticSCORES_PATH:OnceLock<PathBuf> = OnceLock::new();fnmain(){let cli = Cli::parse();let base_dir = match cli.path{Ok(path) => PathBuf::from(path),// This is using platform defaults but otherwise stick with home_dir() + ark-shelfNone => ProjectDirs::from("dev","Ark Builders","Shelf-Desktop").map_or(PathBuf::from(""), |proj| PathBuf::from(proj.data_dir()))};// Initialise global constantsARK_SHELF_WORKING_DIR.set(base_dir.clone()).expect("Setting Working Dir");SCORES_PATH.set(base_dir.join("scores")).expect("Setting Scores Path");}
The text was updated successfully, but these errors were encountered:
The outcome of parsing the CLI is sent to tauri and then called back from it in multiple places, even though it doesn't change.
Sent to tauri:
Pulled back from tauri:
Really these could just be the global statics rather than state. There's a lazy static macro in use but
OnceLock
is also in the standard library now, which could initialise the global.Which instead would look like:
The text was updated successfully, but these errors were encountered: