From 8050cfcd70a16273cc2814fe29c8ee08320d85d3 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 20 Apr 2023 15:13:58 +0200 Subject: cargo fmt --- src/commands/setup.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/commands/setup.rs') diff --git a/src/commands/setup.rs b/src/commands/setup.rs index 0161bd7..40e8c0a 100644 --- a/src/commands/setup.rs +++ b/src/commands/setup.rs @@ -1,14 +1,14 @@ use std::{fs::File, path::Path}; -use crate::{config::Cfg, db::db_setup, error::MLE, devdir}; +use crate::{config::Cfg, db::db_setup, devdir, error::MLE}; pub async fn setup(config: Cfg) -> MLE<()> { let db_file = devdir(format!("{}/data.db", config.data).as_str()); - + if !Path::new(&db_file).exists() { create(config, db_file)?; } - + /* match s_config_get_version(config.clone()) { Ok(ver) => { @@ -21,12 +21,11 @@ pub async fn setup(config: Cfg) -> MLE<()> { Err(..) => to_02(config).await? }; */ - + Ok(()) } fn create(config: Cfg, db_file: String) -> MLE<()> { - println!("Create database"); File::create(db_file)?; @@ -44,7 +43,7 @@ fn create(config: Cfg, db_file: String) -> MLE<()> { // let full_list = lists_get(config.clone(), String::from(&list))?; // // let versions = userlist_get_all_current_version_ids(config.clone(), full_list.clone().id)?; -// +// // let raw_versions = get_raw_versions(String::from(&config.apis.modrinth), versions).await; // // for ver in raw_versions { @@ -69,4 +68,3 @@ fn create(config: Cfg, db_file: String) -> MLE<()> { // } // s_config_update_version(config, String::from("0.4")) //} - -- cgit v1.2.3