From 90683255060a1b702b0df78fe9ffdb1512608313 Mon Sep 17 00:00:00 2001 From: Djkato Date: Wed, 10 May 2023 18:53:18 +0200 Subject: [PATCH] clippy --- Cargo.toml | 8 +++++++- src/lib.rs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b4c0a37..194b01f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,13 @@ name = "installer_lite" version = "1.0.0" edition = "2021" authors = ["Djkáťo "] - +license = "MIT OR Apache-2.0" +description = "A simple Windows Installer creator for your apps." +homepage = "https://github.com/djkato/installer-lite" +repository = "https://github.com/djkato/installer-lite" +readme = "README.md" +keywords = ["installer", "windows", "wrapper"] +categories = ["development-tools::build-utils", "gui", "development-tools"] [lib] name = "installer_lite" path = "src/lib.rs" diff --git a/src/lib.rs b/src/lib.rs index 5480d86..917b21c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,12 +94,12 @@ impl App for Installer { impl Installer { fn install(&mut self) -> Result<(), Box> { let app_path = self.target_path.clone() + r"\" + &self.app_name + ".exe"; - if let Ok(_) = std::fs::read(&app_path) { + if std::fs::read(&app_path).is_ok() { return Err("App already installed".into()); }; std::fs::create_dir_all(&self.target_path)?; self.installer_output += format!("\nCreating App folder: \n{}", &self.target_path).as_str(); - std::fs::write(&app_path, &self.executable)?; + std::fs::write(&app_path, self.executable)?; self.installer_output += "\nCopying executable to folder"; Ok(()) }