summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs7
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::{
7use indicatif::{ProgressBar, ProgressStyle}; 7use indicatif::{ProgressBar, ProgressStyle};
8use serde::{Deserialize, Serialize}; 8use serde::{Deserialize, Serialize};
9 9
10use crate::{check_game_versions, db::db_setup, error::MLE, Modloader, VersionLevel}; 10use 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)]
13pub struct Cfg { 15pub 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 {