From 14cee64c82a72655ae6a4ac0892736a2959dbda5 Mon Sep 17 00:00:00 2001 From: bWanShiTong <157274881+bWanShiTong@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:07:55 +0200 Subject: [PATCH] fix(fs): fix compilation on targets with pointer width 16 and 32 (#1958) --- .changes/change-pr-1958.md | 5 +++++ plugins/fs/src/commands.rs | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changes/change-pr-1958.md diff --git a/.changes/change-pr-1958.md b/.changes/change-pr-1958.md new file mode 100644 index 000000000..59f8fc8a8 --- /dev/null +++ b/.changes/change-pr-1958.md @@ -0,0 +1,5 @@ +--- +"fs": patch +--- + +Fix compilation on targets with pointer width of `16` or `32` diff --git a/plugins/fs/src/commands.rs b/plugins/fs/src/commands.rs index 58f2ce629..99eb5aa09 100644 --- a/plugins/fs/src/commands.rs +++ b/plugins/fs/src/commands.rs @@ -316,12 +316,14 @@ pub async fn read( 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();