Skip to content

Commit

Permalink
fix(fs): fix compilation on targets with pointer width 16 and 32 (#1958)
Browse files Browse the repository at this point in the history
  • Loading branch information
bWanShiTong authored Oct 21, 2024
1 parent 3fd2831 commit 14cee64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/change-pr-1958.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fs": patch
---

Fix compilation on targets with pointer width of `16` or `32`
2 changes: 2 additions & 0 deletions plugins/fs/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,14 @@ pub async fn read<R: Runtime>(
let nread = nread.to_be_bytes();
let mut out = [0; 8];
out[6..].copy_from_slice(&nread);
out
};
#[cfg(target_pointer_width = "32")]
let nread = {
let nread = nread.to_be_bytes();
let mut out = [0; 8];
out[4..].copy_from_slice(&nread);
out
};
#[cfg(target_pointer_width = "64")]
let nread = nread.to_be_bytes();
Expand Down

0 comments on commit 14cee64

Please sign in to comment.