fix(fs): fix compilation on targets with pointer width 16 and 32 (#1958)

pull/1961/head
bWanShiTong 8 months ago committed by GitHub
parent 3fd283121f
commit 14cee64c82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"fs": patch
---
Fix compilation on targets with pointer width of `16` or `32`

@ -316,12 +316,14 @@ pub async fn read<R: Runtime>(
let nread = nread.to_be_bytes(); let nread = nread.to_be_bytes();
let mut out = [0; 8]; let mut out = [0; 8];
out[6..].copy_from_slice(&nread); out[6..].copy_from_slice(&nread);
out
}; };
#[cfg(target_pointer_width = "32")] #[cfg(target_pointer_width = "32")]
let nread = { let nread = {
let nread = nread.to_be_bytes(); let nread = nread.to_be_bytes();
let mut out = [0; 8]; let mut out = [0; 8];
out[4..].copy_from_slice(&nread); out[4..].copy_from_slice(&nread);
out
}; };
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
let nread = nread.to_be_bytes(); let nread = nread.to_be_bytes();

Loading…
Cancel
Save