From 5a6579175d727d30ece8884fcc41587ba7feb225 Mon Sep 17 00:00:00 2001 From: Andrei Gramakov Date: Tue, 21 Jan 2025 21:21:29 +0100 Subject: [PATCH] Add Aknowledgements section to Readme, fix formatting --- README.md | 8 ++++++++ src/creator.rs | 21 +++------------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 903e73e..e7f5da5 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ - [Storage Layout](#storage-layout) - [Template Variables](#template-variables) - [💡 Notes](#-notes) + - [❤️ Aknowledgements](#️-aknowledgements) - [🤝 Contribute](#-contribute) - [License](#license) @@ -103,6 +104,13 @@ Yes, you can use spaces in the variable name! 😄 For questions, feedback, or contributions, don't hesitate to reach out! +## ❤️ Aknowledgements + +| Contributor | Contribution | +| ----------- | ------------ | +| [@Arteiii](https://github.com/Arteiii) | 🪟 Windows installer [#5](https://github.com/an-dr/creator/pull/5)
⚙️ Actions improvements [#5](https://github.com/an-dr/creator/pull/5) +| [@zamazan4ik](https://github.com/zamazan4ik) | 💡 Optimization proposals [#9](https://github.com/an-dr/creator/issues/9) | + ## 🤝 Contribute For the application design and architecture see [docs/design.md](docs/design.md). diff --git a/src/creator.rs b/src/creator.rs index 46ee1f3..4f2e81f 100644 --- a/src/creator.rs +++ b/src/creator.rs @@ -69,12 +69,7 @@ impl Creator { // Replace the variables in the path let mut dest_path_str = dest_path.to_str().expect("The path should be valid").to_string(); for (var_name, var_value) in &self.source_variable_values { - let new_var_name = format!( - "{}{}{}", - Self::TEMPLATE_VAR_PREFIX, - var_name, - Self::TEMPLATE_VAR_SUFFIX - ); + let new_var_name = format!("{}{}{}", Self::TEMPLATE_VAR_PREFIX, var_name, Self::TEMPLATE_VAR_SUFFIX); dest_path_str = dest_path_str.replace(&new_var_name, var_value); } @@ -93,12 +88,7 @@ impl Creator { // Replace the variables in the path let mut dest_path_str = dest_path.to_str().expect("The path should be valid").to_string(); for (var_name, var_value) in &self.source_variable_values { - let new_var_name = format!( - "{}{}{}", - Self::TEMPLATE_VAR_PREFIX, - var_name, - Self::TEMPLATE_VAR_SUFFIX - ); + let new_var_name = format!("{}{}{}", Self::TEMPLATE_VAR_PREFIX, var_name, Self::TEMPLATE_VAR_SUFFIX); dest_path_str = dest_path_str.replace(&new_var_name, var_value); } debug!("Dest path: {:?}\n", dest_path_str); @@ -110,12 +100,7 @@ impl Creator { let content = fs::read_to_string(&dest_path_str)?; let mut new_content = content.clone(); for (var_name, var_value) in &self.source_variable_values { - let var_name = format!( - "{}{}{}", - Self::TEMPLATE_VAR_PREFIX, - var_name, - Self::TEMPLATE_VAR_SUFFIX - ); + let var_name = format!("{}{}{}", Self::TEMPLATE_VAR_PREFIX, var_name, Self::TEMPLATE_VAR_SUFFIX); new_content = new_content.replace(&var_name, var_value); } // Write the new content