mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
fix(core): compile on 32-bit targets (#8032)
This commit is contained in:
committed by
GitHub
parent
a63e71f979
commit
a5686e1507
@@ -193,7 +193,12 @@ fn replace_csp_nonce(
|
||||
) {
|
||||
let mut nonces = Vec::new();
|
||||
*asset = replace_with_callback(asset, token, || {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
let mut raw = [0u8; 8];
|
||||
#[cfg(target_pointer_width = "32")]
|
||||
let mut raw = [0u8; 4];
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
let mut raw = [0u8; 2];
|
||||
getrandom::getrandom(&mut raw).expect("failed to get random bytes");
|
||||
let nonce = usize::from_ne_bytes(raw);
|
||||
nonces.push(nonce);
|
||||
|
||||
Reference in New Issue
Block a user