From c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Mon, 29 May 2023 18:01:12 +0200 Subject: cargo fmt and add fmt file --- src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/config.rs') 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::{ use indicatif::{ProgressBar, ProgressStyle}; use serde::{Deserialize, Serialize}; -use crate::{check_game_versions, db::db_setup, error::MLE, Modloader, VersionLevel}; +use crate::{ + check_game_versions, db::db_setup, error::MLE, Modloader, VersionLevel, +}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Cfg { @@ -44,7 +46,8 @@ impl Cfg { let mut file = match File::open(&configfile) { Ok(file) => file, Err(err) => { - if err.kind() == std::io::ErrorKind::NotFound && path.is_none() { + if err.kind() == std::io::ErrorKind::NotFound && path.is_none() + { create_config(&configfile)?; File::open(&configfile)? } else { -- cgit v1.2.3