rework config system

This commit is contained in:
galister
2024-04-04 22:46:39 +09:00
parent 2d0f733c67
commit e3ae9a9890
7 changed files with 431 additions and 263 deletions

View File

@@ -53,19 +53,3 @@ pub fn load(filename: &str) -> Option<String> {
None
}
}
#[macro_export]
macro_rules! load_with_fallback {
($filename: expr, $fallback: expr) => {
if let Some(data) = config_io::load($filename) {
data
} else {
log::info!(
"Config {}/{} does not exist, using internal fallback",
config_io::CONFIG_ROOT_PATH.to_string_lossy(),
$filename
);
include_str!($fallback).to_string()
}
};
}