Skip to main content

muse2/
lib.rs

1//! Common functionality for MUSE2.
2#![warn(missing_docs)]
3
4/// The main GitHub issues page for MUSE2
5pub const ISSUES_URL: &str = concat!(env!("CARGO_PKG_REPOSITORY"), "/issues");
6
7use dirs::config_dir;
8use std::path::PathBuf;
9
10pub mod agent;
11pub mod asset;
12pub mod cli;
13pub mod commodity;
14pub mod example;
15pub mod finance;
16pub mod graph;
17pub mod id;
18pub mod input;
19pub mod log;
20pub mod model;
21pub mod output;
22pub mod patch;
23pub mod process;
24pub mod region;
25pub mod settings;
26pub mod simulation;
27pub mod time_slice;
28pub mod units;
29
30#[cfg(test)]
31mod fixture;
32
33/// Get config dir for program.
34///
35/// In the unlikely event this path cannot be retrieved, the CWD will be returned.
36pub fn get_muse2_config_dir() -> PathBuf {
37    let Some(mut config_dir) = config_dir() else {
38        return PathBuf::default();
39    };
40
41    config_dir.push("muse2");
42    config_dir
43}