Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/cleanup-cow-use.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri": patch:enhance
---

Remove unused `std::borrow::Cow`, no user facing changes.
6 changes: 3 additions & 3 deletions crates/tauri-utils/src/pattern/isolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Keys {
/// Decrypts a message using the generated keys.
pub fn decrypt(&self, raw: RawIsolationPayload<'_>) -> Result<Vec<u8>, Error> {
let RawIsolationPayload { nonce, payload, .. } = raw;
let nonce: [u8; 12] = nonce.as_ref().try_into()?;
let nonce: [u8; 12] = nonce.try_into()?;
self
.aes_gcm
.key
Expand All @@ -117,8 +117,8 @@ impl Keys {
#[derive(Debug, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RawIsolationPayload<'a> {
nonce: Cow<'a, [u8]>,
payload: Cow<'a, [u8]>,
nonce: &'a [u8],
payload: &'a [u8],
content_type: Cow<'a, str>,
}

Expand Down
1 change: 1 addition & 0 deletions crates/tauri/src/ipc/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ fn handle_ipc_message<R: Runtime>(request: Request<String>, manager: &AppManager
cmd: String,
callback: CallbackFn,
error: CallbackFn,
#[serde(borrow)]
payload: crate::utils::pattern::isolation::RawIsolationPayload<'a>,
options: Option<RequestOptions>,
#[serde(rename = "__TAURI_INVOKE_KEY__")]
Expand Down
Loading