From b36b7a56c63888f7d7a205189a50ea332349bdbb Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 5 Jun 2026 13:45:05 +0800 Subject: [PATCH 1/2] refactor!: remove `tauri_utils::acl::Value` --- crates/tauri-cli/config.schema.json | 62 +----- .../src/migrate/migrations/v1/config.rs | 18 +- .../schemas/capability.schema.json | 62 +----- .../schemas/config.schema.json | 62 +----- .../schemas/permission.schema.json | 62 +----- .../schemas/scope.schema.json | 64 +----- crates/tauri-utils/src/acl/mod.rs | 11 +- crates/tauri-utils/src/acl/resolved.rs | 11 +- crates/tauri-utils/src/acl/value.rs | 201 ------------------ crates/tauri/src/ipc/authority.rs | 14 +- .../permissions/schemas/schema.json | 62 +----- 11 files changed, 39 insertions(+), 590 deletions(-) delete mode 100644 crates/tauri-utils/src/acl/value.rs diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 898317a465a0..78b7add91d5c 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1543,9 +1543,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -1553,9 +1551,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true } } } @@ -1564,60 +1560,6 @@ "Identifier": { "type": "string" }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, "Target": { "description": "Platform target.", "oneOf": [ diff --git a/crates/tauri-cli/src/migrate/migrations/v1/config.rs b/crates/tauri-cli/src/migrate/migrations/v1/config.rs index 3de72747d5c6..7cc739b74005 100644 --- a/crates/tauri-cli/src/migrate/migrations/v1/config.rs +++ b/crates/tauri-cli/src/migrate/migrations/v1/config.rs @@ -7,14 +7,10 @@ use crate::{error::Context, ErrorExt, Result}; use serde_json::{Map, Value}; use tauri_utils::acl::{ capability::{Capability, PermissionEntry}, - Scopes, Value as AclValue, + Scopes, }; -use std::{ - collections::{BTreeMap, HashSet}, - fs, - path::Path, -}; +use std::{collections::HashSet, fs, path::Path}; pub fn migrate(tauri_dir: &Path) -> Result { if let Ok((mut config, config_path)) = @@ -500,11 +496,11 @@ fn allowlist_to_permissions( if !(fs_allowed.is_empty() && fs_denied.is_empty()) { let fs_allowed = fs_allowed .into_iter() - .map(|p| AclValue::String(p.to_string_lossy().into())) + .map(|p| serde_json::Value::String(p.to_string_lossy().into())) .collect::>(); let fs_denied = fs_denied .into_iter() - .map(|p| AclValue::String(p.to_string_lossy().into())) + .map(|p| serde_json::Value::String(p.to_string_lossy().into())) .collect::>(); permissions.push(PermissionEntry::ExtendedPermission { identifier: "fs:scope".to_string().try_into().unwrap(), @@ -611,9 +607,9 @@ fn allowlist_to_permissions( .0 .into_iter() .map(|p| { - let mut map = BTreeMap::new(); - map.insert("url".to_string(), AclValue::String(p.to_string())); - AclValue::Map(map) + let mut map = serde_json::Map::new(); + map.insert("url".to_string(), serde_json::Value::String(p.to_string())); + serde_json::Value::Object(map) }) .collect::>(); diff --git a/crates/tauri-schema-generator/schemas/capability.schema.json b/crates/tauri-schema-generator/schemas/capability.schema.json index 0769b1bfd18b..c318862354e5 100644 --- a/crates/tauri-schema-generator/schemas/capability.schema.json +++ b/crates/tauri-schema-generator/schemas/capability.schema.json @@ -115,9 +115,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -125,9 +123,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true } } } @@ -136,60 +132,6 @@ "Identifier": { "type": "string" }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, "Target": { "description": "Platform target.", "oneOf": [ diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 898317a465a0..78b7add91d5c 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1543,9 +1543,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -1553,9 +1551,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true } } } @@ -1564,60 +1560,6 @@ "Identifier": { "type": "string" }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, "Target": { "description": "Platform target.", "oneOf": [ diff --git a/crates/tauri-schema-generator/schemas/permission.schema.json b/crates/tauri-schema-generator/schemas/permission.schema.json index b13ba4851f83..adfad8a61724 100644 --- a/crates/tauri-schema-generator/schemas/permission.schema.json +++ b/crates/tauri-schema-generator/schemas/permission.schema.json @@ -91,9 +91,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -101,66 +99,10 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true } } }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, "Target": { "description": "Platform target.", "oneOf": [ diff --git a/crates/tauri-schema-generator/schemas/scope.schema.json b/crates/tauri-schema-generator/schemas/scope.schema.json index cedbf22d6b23..0d0d88d65032 100644 --- a/crates/tauri-schema-generator/schemas/scope.schema.json +++ b/crates/tauri-schema-generator/schemas/scope.schema.json @@ -10,9 +10,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -20,65 +18,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } - } - }, - "definitions": { - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] + "items": true } } } \ No newline at end of file diff --git a/crates/tauri-utils/src/acl/mod.rs b/crates/tauri-utils/src/acl/mod.rs index b9bb6a2d0ebc..bd4e97617bd7 100644 --- a/crates/tauri-utils/src/acl/mod.rs +++ b/crates/tauri-utils/src/acl/mod.rs @@ -40,7 +40,7 @@ use crate::{ platform::Target, }; -pub use self::{identifier::*, value::*}; +pub use self::identifier::*; /// Known foldername of the permission schema files pub const PERMISSION_SCHEMAS_FOLDER_NAME: &str = "schemas"; @@ -66,7 +66,6 @@ pub mod manifest; pub mod resolved; #[cfg(feature = "schema")] pub mod schema; -pub mod value; /// Possible errors while processing ACL files. #[derive(Debug, Error)] @@ -202,10 +201,10 @@ pub struct Commands { pub struct Scopes { /// Data that defines what is allowed by the scope. #[serde(skip_serializing_if = "Option::is_none")] - pub allow: Option>, + pub allow: Option>, /// Data that defines what is denied by the scope. This should be prioritized by validation logic. #[serde(skip_serializing_if = "Option::is_none")] - pub deny: Option>, + pub deny: Option>, } impl Scopes { @@ -496,8 +495,8 @@ mod build_ { impl ToTokens for Scopes { fn to_tokens(&self, tokens: &mut TokenStream) { - let allow = opt_vec_lit(self.allow.as_ref(), identity); - let deny = opt_vec_lit(self.deny.as_ref(), identity); + let allow = opt_vec_lit(self.allow.as_ref(), json_value_lit); + let deny = opt_vec_lit(self.deny.as_ref(), json_value_lit); literal_struct!(tokens, ::tauri::utils::acl::Scopes, allow, deny) } } diff --git a/crates/tauri-utils/src/acl/resolved.rs b/crates/tauri-utils/src/acl/resolved.rs index 8aa4322f5640..a7494da406ef 100644 --- a/crates/tauri-utils/src/acl/resolved.rs +++ b/crates/tauri-utils/src/acl/resolved.rs @@ -12,8 +12,7 @@ use super::{ capability::{Capability, PermissionEntry}, has_app_manifest, manifest::Manifest, - Commands, Error, ExecutionContext, Identifier, Permission, PermissionSet, Scopes, Value, - APP_ACL_KEY, + Commands, Error, ExecutionContext, Identifier, Permission, PermissionSet, Scopes, APP_ACL_KEY, }; /// A key for a scope, used to link a [`ResolvedCommand#structfield.scope`] to the store [`Resolved#structfield.scopes`]. @@ -60,9 +59,9 @@ impl fmt::Debug for ResolvedCommand { #[derive(Debug, Default, Clone)] pub struct ResolvedScope { /// Allows something on the command. - pub allow: Vec, + pub allow: Vec, /// Denies something on the command. - pub deny: Vec, + pub deny: Vec, } /// Resolved access control list. @@ -504,8 +503,8 @@ mod build { impl ToTokens for ResolvedScope { fn to_tokens(&self, tokens: &mut TokenStream) { - let allow = vec_lit(&self.allow, identity); - let deny = vec_lit(&self.deny, identity); + let allow = vec_lit(&self.allow, json_value_lit); + let deny = vec_lit(&self.deny, json_value_lit); literal_struct!( tokens, ::tauri::utils::acl::resolved::ResolvedScope, diff --git a/crates/tauri-utils/src/acl/value.rs b/crates/tauri-utils/src/acl/value.rs deleted file mode 100644 index 24ac91eb7382..000000000000 --- a/crates/tauri-utils/src/acl/value.rs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2019-2024 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -//! A [`Value`] that is used instead of [`toml::Value`] or [`serde_json::Value`] -//! to support both formats. - -use std::collections::BTreeMap; -use std::fmt::Debug; - -use serde::{Deserialize, Serialize}; - -/// A valid ACL number. -#[derive(Debug, PartialEq, Serialize, Deserialize, Copy, Clone, PartialOrd)] -#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -#[serde(untagged)] -pub enum Number { - /// Represents an [`i64`]. - Int(i64), - - /// Represents a [`f64`]. - Float(f64), -} - -impl From for Number { - #[inline(always)] - fn from(value: i64) -> Self { - Self::Int(value) - } -} - -impl From for Number { - #[inline(always)] - fn from(value: f64) -> Self { - Self::Float(value) - } -} - -/// All supported ACL values. -#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, PartialOrd)] -#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -#[serde(untagged)] -pub enum Value { - /// Represents a null JSON value. - Null, - - /// Represents a [`bool`]. - Bool(bool), - - /// Represents a valid ACL [`Number`]. - Number(Number), - - /// Represents a [`String`]. - String(String), - - /// Represents a list of other [`Value`]s. - List(Vec), - - /// Represents a map of [`String`] keys to [`Value`]s. - Map(BTreeMap), -} - -impl From for serde_json::Value { - fn from(value: Value) -> Self { - match value { - Value::Null => serde_json::Value::Null, - Value::Bool(b) => serde_json::Value::Bool(b), - Value::Number(Number::Float(f)) => { - serde_json::Value::Number(serde_json::Number::from_f64(f).unwrap()) - } - Value::Number(Number::Int(i)) => serde_json::Value::Number(i.into()), - Value::String(s) => serde_json::Value::String(s), - Value::List(list) => serde_json::Value::Array(list.into_iter().map(Into::into).collect()), - Value::Map(map) => serde_json::Value::Object( - map - .into_iter() - .map(|(key, value)| (key, value.into())) - .collect(), - ), - } - } -} - -impl From for Value { - fn from(value: serde_json::Value) -> Self { - match value { - serde_json::Value::Null => Value::Null, - serde_json::Value::Bool(b) => Value::Bool(b), - serde_json::Value::Number(n) => Value::Number(if let Some(f) = n.as_f64() { - Number::Float(f) - } else if let Some(n) = n.as_u64() { - Number::Int(n as i64) - } else if let Some(n) = n.as_i64() { - Number::Int(n) - } else { - Number::Int(0) - }), - serde_json::Value::String(s) => Value::String(s), - serde_json::Value::Array(list) => Value::List(list.into_iter().map(Into::into).collect()), - serde_json::Value::Object(map) => Value::Map( - map - .into_iter() - .map(|(key, value)| (key, value.into())) - .collect(), - ), - } - } -} - -impl From for Value { - #[inline(always)] - fn from(value: bool) -> Self { - Self::Bool(value) - } -} - -impl> From for Value { - #[inline(always)] - fn from(value: T) -> Self { - Self::Number(value.into()) - } -} - -impl From for Value { - #[inline(always)] - fn from(value: String) -> Self { - Value::String(value) - } -} - -impl From for Value { - #[inline(always)] - fn from(value: toml::Value) -> Self { - use toml::Value as Toml; - - match value { - Toml::String(s) => s.into(), - Toml::Integer(i) => i.into(), - Toml::Float(f) => f.into(), - Toml::Boolean(b) => b.into(), - Toml::Datetime(d) => d.to_string().into(), - Toml::Array(a) => Value::List(a.into_iter().map(Value::from).collect()), - Toml::Table(t) => Value::Map(t.into_iter().map(|(k, v)| (k, v.into())).collect()), - } - } -} - -#[cfg(any(feature = "build", feature = "build-2"))] -mod build { - use std::convert::identity; - - use crate::tokens::*; - - use super::*; - use proc_macro2::TokenStream; - use quote::{quote, ToTokens, TokenStreamExt}; - - impl ToTokens for Number { - fn to_tokens(&self, tokens: &mut TokenStream) { - let prefix = quote! { ::tauri::utils::acl::Number }; - - tokens.append_all(match self { - Self::Int(i) => { - quote! { #prefix::Int(#i) } - } - Self::Float(f) => { - quote! { #prefix::Float (#f) } - } - }); - } - } - - impl ToTokens for Value { - fn to_tokens(&self, tokens: &mut TokenStream) { - let prefix = quote! { ::tauri::utils::acl::Value }; - - tokens.append_all(match self { - Value::Null => quote! { #prefix::Null }, - Value::Bool(bool) => quote! { #prefix::Bool(#bool) }, - Value::Number(number) => quote! { #prefix::Number(#number) }, - Value::String(str) => { - let s = str_lit(str); - quote! { #prefix::String(#s) } - } - Value::List(vec) => { - let items = vec_lit(vec, identity); - quote! { #prefix::List(#items) } - } - Value::Map(map) => { - let map = map_lit( - quote! { ::std::collections::BTreeMap }, - map, - str_lit, - identity, - ); - quote! { #prefix::Map(#map) } - } - }); - } - } -} diff --git a/crates/tauri/src/ipc/authority.rs b/crates/tauri/src/ipc/authority.rs index 8bb81e398f26..d74bf32340fb 100644 --- a/crates/tauri/src/ipc/authority.rs +++ b/crates/tauri/src/ipc/authority.rs @@ -14,7 +14,7 @@ use tauri_utils::acl::capability::CapabilityFile; use tauri_utils::acl::manifest::Manifest; use tauri_utils::acl::{ resolved::{Resolved, ResolvedCommand, ResolvedScope, ScopeKey}, - ExecutionContext, Value, APP_ACL_KEY, + ExecutionContext, APP_ACL_KEY, }; use url::Url; @@ -680,13 +680,19 @@ pub trait ScopeObject: Sized + Send + Sync + Debug + 'static { /// The error type. type Error: std::error::Error + Send + Sync; /// Deserialize the raw scope value. - fn deserialize(app: &AppHandle, raw: Value) -> Result; + fn deserialize( + app: &AppHandle, + raw: serde_json::Value, + ) -> Result; } impl ScopeObject for T { type Error = serde_json::Error; - fn deserialize(_app: &AppHandle, raw: Value) -> Result { - serde_json::from_value(raw.into()) + fn deserialize( + _app: &AppHandle, + raw: serde_json::Value, + ) -> Result { + serde_json::from_value(raw) } } diff --git a/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json b/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json index 0bc3ba1c48be..491c45d8b4b7 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json +++ b/examples/api/src-tauri/tauri-plugin-sample/permissions/schemas/schema.json @@ -181,9 +181,7 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true }, "deny": { "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", @@ -191,66 +189,10 @@ "array", "null" ], - "items": { - "$ref": "#/definitions/Value" - } + "items": true } } }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, "Target": { "description": "Platform target.", "oneOf": [ From 208ac8a4df20a350e7cc578ba99dd5150bdfd4e8 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 5 Jun 2026 13:56:17 +0800 Subject: [PATCH 2/2] clippy --- crates/tauri-cli/src/migrate/migrations/v1/config.rs | 2 +- crates/tauri/src/ipc/capability_builder.rs | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/crates/tauri-cli/src/migrate/migrations/v1/config.rs b/crates/tauri-cli/src/migrate/migrations/v1/config.rs index 7cc739b74005..fa5c1697d605 100644 --- a/crates/tauri-cli/src/migrate/migrations/v1/config.rs +++ b/crates/tauri-cli/src/migrate/migrations/v1/config.rs @@ -567,7 +567,7 @@ fn allowlist_to_permissions( .scope .0 .into_iter() - .map(|p| serde_json::to_value(p).unwrap().into()) + .map(|p| serde_json::to_value(p).unwrap()) .collect::>(); permissions.push(PermissionEntry::ExtendedPermission { diff --git a/crates/tauri/src/ipc/capability_builder.rs b/crates/tauri/src/ipc/capability_builder.rs index 62b5113bd42e..9182a0fe3e13 100644 --- a/crates/tauri/src/ipc/capability_builder.rs +++ b/crates/tauri/src/ipc/capability_builder.rs @@ -112,19 +112,11 @@ impl CapabilityBuilder { let allowed_scope = allowed .into_iter() - .map(|a| { - serde_json::to_value(a) - .expect("failed to serialize scope") - .into() - }) + .map(|a| serde_json::to_value(a).expect("failed to serialize scope")) .collect(); let denied_scope = denied .into_iter() - .map(|a| { - serde_json::to_value(a) - .expect("failed to serialize scope") - .into() - }) + .map(|a| serde_json::to_value(a).expect("failed to serialize scope")) .collect(); let scope = Scopes { allow: Some(allowed_scope),