From 80d9f2fb76e2631033ae7f76a7d5eb8716fd6542 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Sat, 13 May 2023 02:31:29 +0300 Subject: [PATCH] fix diffing features --- core/tauri-build/src/lib.rs | 2 +- core/tauri-utils/src/config.rs | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 1584fdc18..8da6a0a2f 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -349,7 +349,7 @@ dependencies {" if !error_message.is_empty() { return Err(anyhow!(" - The `tauri` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`. + The `tauri` dependency features on the `Cargo.toml` file does not match the `tauri.conf.json` config. Please run `tauri dev` or `tauri build` or {}. ", error_message)); } diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index c3dd2e912..39874380a 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -1200,7 +1200,7 @@ pub struct SecurityConfig { #[serde(default, alias = "dangerous-remote-domain-ipc-access")] pub dangerous_remote_domain_ipc_access: Vec, /// Custom protocol config. - #[serde(default, alias="asset-protocol")] + #[serde(default, alias = "asset-protocol")] pub asset_protocol: AssetProtocolConfig, } @@ -1257,7 +1257,12 @@ impl TauriConfig { /// Returns all Cargo features. #[allow(dead_code)] pub fn all_features() -> Vec<&'static str> { - vec!["system-tray", "macos-private-api", "isolation"] + vec![ + "system-tray", + "macos-private-api", + "isolation", + "protocol-asset", + ] } /// Returns the enabled Cargo features. @@ -1273,11 +1278,7 @@ impl TauriConfig { if let PatternKind::Isolation { .. } = self.pattern { features.push("isolation"); } - if self - .security - .asset_protocol - .enable - { + if self.security.asset_protocol.enable { features.push("protocol-asset"); } features.sort_unstable(); @@ -2293,7 +2294,7 @@ mod build { let freeze_prototype = self.freeze_prototype; let dangerous_disable_asset_csp_modification = &self.dangerous_disable_asset_csp_modification; let dangerous_remote_domain_ipc_access = - vec_lit(&self.dangerous_remote_domain_ipc_access, identity); + vec_lit(&self.dangerous_remote_domain_ipc_access, identity); let asset_protocol = &self.asset_protocol; literal_struct!(