Skip to content

Commit

Permalink
fix(core): compile on 32-bit targets (#8032)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Oct 17, 2023
1 parent a63e71f commit a5686e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/tauri/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a5686e1

Please sign in to comment.