diff options
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() |