summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index a0dfbbe..ba1b46a 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,18 +1,20 @@
1use config::{Config, File, FileFormat}; 1use config::{Config, File, FileFormat};
2use serde::Deserialize; 2use serde::Deserialize;
3 3
4#[derive(Debug, Deserialize)] 4#[derive(Debug, Clone,Deserialize)]
5pub struct Cfg { 5pub struct Cfg {
6 pub data: String,
6 pub apis: Apis, 7 pub apis: Apis,
7} 8}
8 9
9#[derive(Debug, Deserialize)] 10#[derive(Debug, Clone, Deserialize)]
10pub struct Apis { 11pub struct Apis {
11 pub modrinth: String, 12 pub modrinth: String,
12} 13}
13 14
14impl Cfg { 15impl Cfg {
15 pub fn init(path: &str) -> Self { 16 pub fn init(path: &str) -> Self {
17 //TODO Error Handling
16 Config::builder() 18 Config::builder()
17 .add_source(File::new(path, FileFormat::Ini)) 19 .add_source(File::new(path, FileFormat::Ini))
18 .build() 20 .build()