From 513431a5a57a67b669caddc111ce5f2a47011ff2 Mon Sep 17 00:00:00 2001 From: Fankai Liu Date: Sun, 26 Nov 2023 18:31:47 +0800 Subject: [PATCH] refactor code --- src/test/test_write_project.rs | 2 +- src/utils/create_project.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/test_write_project.rs b/src/test/test_write_project.rs index 0adf2bd..42c9d6d 100644 --- a/src/test/test_write_project.rs +++ b/src/test/test_write_project.rs @@ -36,7 +36,7 @@ mod tests { for (template_type, db_type, db_conn_type) in combinations { // Generate a unique project name for each combination let project_name = format!("test_{:?}_{:?}_{:?}", template_type, db_type, db_conn_type); - + println!("Testing combination: {:?}", project_name); let path_str = format!("target/{}", project_name); std::fs::remove_dir_all(&path_str).unwrap_or(()); let path = Path::new(&path_str); diff --git a/src/utils/create_project.rs b/src/utils/create_project.rs index c9cc8ba..8fa5dc4 100644 --- a/src/utils/create_project.rs +++ b/src/utils/create_project.rs @@ -598,15 +598,15 @@ fn create_basic_file( std::fs::create_dir_all(&src_path)?; let templates = [ + ( + "Cargo.toml", + include_str!("../template/src/cargo_template.hbs"), + ), //src ( "src/main.rs", include_str!("../template/src/main_template.hbs"), ), - ( - "src/Cargo.toml", - include_str!("../template/src/cargo_template.hbs"), - ), ( "src/config.rs", include_str!("../template/src/config_template.hbs"),