diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 3858484..f0eb8f7 100644 --- a/src/config.rs +++ b/src/config.rs | |||
@@ -7,7 +7,9 @@ use std::{ | |||
7 | use indicatif::{ProgressBar, ProgressStyle}; | 7 | use indicatif::{ProgressBar, ProgressStyle}; |
8 | use serde::{Deserialize, Serialize}; | 8 | use serde::{Deserialize, Serialize}; |
9 | 9 | ||
10 | use crate::{check_game_versions, db::db_setup, error::MLE, Modloader, VersionLevel}; | 10 | use crate::{ |
11 | check_game_versions, db::db_setup, error::MLE, Modloader, VersionLevel, | ||
12 | }; | ||
11 | 13 | ||
12 | #[derive(Debug, Clone, Serialize, Deserialize)] | 14 | #[derive(Debug, Clone, Serialize, Deserialize)] |
13 | pub struct Cfg { | 15 | pub struct Cfg { |
@@ -44,7 +46,8 @@ impl Cfg { | |||
44 | let mut file = match File::open(&configfile) { | 46 | let mut file = match File::open(&configfile) { |
45 | Ok(file) => file, | 47 | Ok(file) => file, |
46 | Err(err) => { | 48 | Err(err) => { |
47 | if err.kind() == std::io::ErrorKind::NotFound && path.is_none() { | 49 | if err.kind() == std::io::ErrorKind::NotFound && path.is_none() |
50 | { | ||
48 | create_config(&configfile)?; | 51 | create_config(&configfile)?; |
49 | File::open(&configfile)? | 52 | File::open(&configfile)? |
50 | } else { | 53 | } else { |