blob: ba1b46a9c9afaea0a86ebf19b30d9806d232fb19 (
plain) (
tree)
|
|
use config::{Config, File, FileFormat};
use serde::Deserialize;
#[derive(Debug, Clone,Deserialize)]
pub struct Cfg {
pub data: String,
pub apis: Apis,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Apis {
pub modrinth: String,
}
impl Cfg {
pub fn init(path: &str) -> Self {
//TODO Error Handling
Config::builder()
.add_source(File::new(path, FileFormat::Ini))
.build()
.unwrap()
.try_deserialize()
.unwrap()
}
}
|