summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-05-29 18:01:12 +0200
committerfxqnlr <[email protected]>2023-05-29 18:01:12 +0200
commitc7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 (patch)
tree116075aaa57c35afca2749719d450c3cb473ab3e /src/config.rs
parent7755c9acf6b8a1d81c03ef1138e80a162f36e743 (diff)
downloadmodlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.tar
modlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.tar.gz
modlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.zip
cargo fmt and add fmt file
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 {