summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2022-11-01 23:00:45 +0100
committerfxqnlr <[email protected]>2022-11-01 23:00:45 +0100
commitb125dfd03084fff47ab8e90d002c6699b762d998 (patch)
tree151677fb5e88105c06e1072c2fa309f55afaba36 /src/config.rs
parentd38f09a247b8bf1ed328c342f84b74581905317d (diff)
downloadmodlist-b125dfd03084fff47ab8e90d002c6699b762d998.tar
modlist-b125dfd03084fff47ab8e90d002c6699b762d998.tar.gz
modlist-b125dfd03084fff47ab8e90d002c6699b762d998.zip
added list stuff + beginnings of mods
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()