diff options
author | fxqnlr <[email protected]> | 2022-11-01 23:00:45 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2022-11-01 23:00:45 +0100 |
commit | b125dfd03084fff47ab8e90d002c6699b762d998 (patch) | |
tree | 151677fb5e88105c06e1072c2fa309f55afaba36 /src/config.rs | |
parent | d38f09a247b8bf1ed328c342f84b74581905317d (diff) | |
download | modlist-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.rs | 6 |
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 @@ | |||
1 | use config::{Config, File, FileFormat}; | 1 | use config::{Config, File, FileFormat}; |
2 | use serde::Deserialize; | 2 | use serde::Deserialize; |
3 | 3 | ||
4 | #[derive(Debug, Deserialize)] | 4 | #[derive(Debug, Clone,Deserialize)] |
5 | pub struct Cfg { | 5 | pub 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)] |
10 | pub struct Apis { | 11 | pub struct Apis { |
11 | pub modrinth: String, | 12 | pub modrinth: String, |
12 | } | 13 | } |
13 | 14 | ||
14 | impl Cfg { | 15 | impl 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() |