Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
amr-crabnebula committed Jun 26, 2024
1 parent e591be1 commit 4b1759d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 0 additions & 2 deletions crates/packager/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
15 changes: 5 additions & 10 deletions crates/packager/src/codesign/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -30,27 +31,21 @@ pub struct SignParams {
pub sign_command: Option<String>,
}

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(),
Expand Down
2 changes: 1 addition & 1 deletion crates/packager/src/package/nsis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down

0 comments on commit 4b1759d

Please sign in to comment.