From 8050cfcd70a16273cc2814fe29c8ee08320d85d3 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 20 Apr 2023 15:13:58 +0200 Subject: cargo fmt --- src/config.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 075d884..1b54d5f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,8 +1,11 @@ -use std::{fs::File, io::{Read, Write}}; +use std::{ + fs::File, + io::{Read, Write}, +}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; -use crate::{error::MLE, devdir}; +use crate::{devdir, error::MLE}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Cfg { @@ -24,7 +27,12 @@ impl Cfg { Err(err) => { if err.kind() == std::io::ErrorKind::NotFound { println!("No config file found, creating one"); - let default_cfg = Cfg { data: String::from("./"), apis: Apis { modrinth: String::from("https://api.modrinth.com/v2/") } }; + let default_cfg = Cfg { + data: String::from("./"), + apis: Apis { + modrinth: String::from("https://api.modrinth.com/v2/"), + }, + }; let mut file = File::create(devdir(configfile.to_str().unwrap()))?; println!("Created config file"); file.write_all(toml::to_string(&default_cfg)?.as_bytes())?; -- cgit v1.2.3