From 4b1759d3e70a452823fee92eb17f549a6eaf0c1c Mon Sep 17 00:00:00 2001 From: amr-crabnebula Date: Wed, 26 Jun 2024 05:36:34 +0300 Subject: [PATCH] chore: clippy --- crates/packager/src/cli/mod.rs | 2 -- crates/packager/src/codesign/windows.rs | 15 +++++---------- crates/packager/src/package/nsis/mod.rs | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/crates/packager/src/cli/mod.rs b/crates/packager/src/cli/mod.rs index 321f3401..91c4635b 100644 --- a/crates/packager/src/cli/mod.rs +++ b/crates/packager/src/cli/mod.rs @@ -4,8 +4,6 @@ //! The cli entry point -#![cfg(feature = "cli")] - use std::{ffi::OsString, fmt::Write, path::PathBuf}; use clap::{ArgAction, CommandFactory, FromArgMatches, Parser, Subcommand}; diff --git a/crates/packager/src/codesign/windows.rs b/crates/packager/src/codesign/windows.rs index 26eb2063..16d2b119 100644 --- a/crates/packager/src/codesign/windows.rs +++ b/crates/packager/src/codesign/windows.rs @@ -21,6 +21,7 @@ use crate::{config::Config, shell::CommandExt, util}; use crate::util::Bitness; #[derive(Debug)] +#[allow(dead_code)] pub struct SignParams { pub product_name: String, pub digest_algorithm: String, @@ -30,27 +31,21 @@ pub struct SignParams { pub sign_command: Option, } -pub(crate) trait ConfigSignExt { - fn can_sign(&self) -> bool; - fn custom_sign_command(&self) -> bool; - fn sign_params(&self) -> SignParams; -} - -impl ConfigSignExt for Config { - fn can_sign(&self) -> bool { +impl Config { + pub(crate) fn can_sign(&self) -> bool { self.windows() .and_then(|w| w.certificate_thumbprint.as_ref()) .is_some() || self.custom_sign_command() } - fn custom_sign_command(&self) -> bool { + pub(crate) fn custom_sign_command(&self) -> bool { self.windows() .and_then(|w| w.sign_command.as_ref()) .is_some() } - fn sign_params(&self) -> SignParams { + pub(crate) fn sign_params(&self) -> SignParams { let windows = self.windows(); SignParams { product_name: self.product_name.clone(), diff --git a/crates/packager/src/package/nsis/mod.rs b/crates/packager/src/package/nsis/mod.rs index 6f37f0a4..2079ff62 100644 --- a/crates/packager/src/package/nsis/mod.rs +++ b/crates/packager/src/package/nsis/mod.rs @@ -14,7 +14,7 @@ use handlebars::{to_json, Handlebars}; use super::Context; use crate::{ - codesign::windows::{self as codesign, ConfigSignExt}, + codesign::windows::{self as codesign}, util::verify_file_hash, }; use crate::{