chore: Fix clippy 1.84 warnings (#12339)

This commit is contained in:
Fabian-Lars
2025-01-10 19:10:25 +01:00
committed by GitHub
parent b3c258d640
commit e98cd594ae
11 changed files with 710 additions and 524 deletions

View File

@@ -38,7 +38,7 @@ jobs:
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.71
override: true
- name: setup node
uses: actions/setup-node@v2

View File

@@ -37,7 +37,7 @@ jobs:
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.71.0
override: true
- name: install Linux dependencies

View File

@@ -55,7 +55,7 @@ fn copy_binaries(
.to_string_lossy()
.replace(&format!("-{target_triple}"), "");
if package_name.map_or(false, |n| n == &file_name) {
if package_name == Some(&file_name) {
return Err(anyhow::anyhow!(
"Cannot define a sidecar with the same name as the Cargo package name `{}`. Please change the sidecar name in the filesystem and the Tauri configuration.",
file_name

View File

@@ -39,6 +39,7 @@ pub enum CodegenConfigError {
///
/// If the passed path is relative, it should be relative to the current working directory of the
/// compiling crate.
#[allow(clippy::result_large_err)]
pub fn get_config(path: &Path) -> Result<(Config, PathBuf), CodegenConfigError> {
let path = if path.is_relative() {
let cwd = std::env::current_dir().map_err(CodegenConfigError::CurrentDir)?;

View File

@@ -2,6 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![allow(clippy::result_large_err)]
use crate::config::Config;
use json_patch::merge;
use serde::de::DeserializeOwned;

View File

@@ -5,6 +5,7 @@
//! Types and functions related to desktop notifications.
#[cfg(windows)]
#[allow(unused_imports)]
use std::path::MAIN_SEPARATOR as SEP;
/// The desktop notification definition.

View File

@@ -153,7 +153,7 @@ fn build_app_v2(cwd: &Path, envs: Vec<(&str, &str)>, config: &ConfigV2, target:
#[cfg(target_os = "macos")]
command.args(["--bundles", target.name()]);
if config.bundle.create_updater_artifacts.map_or(false, |c| c) {
if config.bundle.create_updater_artifacts == Some(true) {
#[cfg(windows)]
command.args(["--bundles", "msi", "nsis"]);

View File

@@ -74,8 +74,7 @@ pub fn bundle_project(settings: Settings) -> crate::Result<Vec<Bundle>> {
// Sign the sidecar binaries
for bin in settings.external_binaries() {
let path = bin?;
let skip =
std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").map_or(false, |v| v == "true");
let skip = std::env::var("TAURI_SKIP_SIDECAR_SIGNATURE_CHECK").is_ok_and(|v| v == "true");
if skip {
continue;
}

1215
tooling/cli/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -93,7 +93,7 @@ pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings {
enable_elevated_update_task: config.enable_elevated_update_task,
banner_path: config.banner_path,
dialog_image_path: config.dialog_image_path,
fips_compliant: var_os("TAURI_FIPS_COMPLIANT").map_or(false, |v| v == "true"),
fips_compliant: var_os("TAURI_FIPS_COMPLIANT").is_some_and(|v| v == "true"),
}
}

View File

@@ -101,7 +101,7 @@ pub fn build(
let bin_name = bin_path.file_stem().unwrap();
if !std::env::var("STATIC_VCRUNTIME").map_or(false, |v| v == "false") {
if !std::env::var("STATIC_VCRUNTIME").is_ok_and(|v| v == "false") {
std::env::set_var("STATIC_VCRUNTIME", "true");
}