From 723ec2a6e8fd36b40c14caf1e503211f4cba44fb Mon Sep 17 00:00:00 2001 From: "Andrew Phillips (aider)" Date: Mon, 12 May 2025 11:15:32 -0300 Subject: [PATCH] fix: convert Fd to raw descriptor using .0 access This addresses the E0412 error by correctly extracting the raw file descriptor from the nix::unistd::Fd newtype wrapper. --- src/modes/diff.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modes/diff.rs b/src/modes/diff.rs index 1002205..d9307fa 100644 --- a/src/modes/diff.rs +++ b/src/modes/diff.rs @@ -147,7 +147,9 @@ pub fn mode_diff( compression_type: CompressionType, fd_write: nix::unistd::Fd, ) -> std::thread::JoinHandle<()> { - let pipe_writer_raw = unsafe { std::fs::File::from_raw_fd(fd_write.into_raw()) }; + // Convert nix::unistd::Fd to raw fd + let raw_fd = fd_write.0; + let pipe_writer_raw = unsafe { std::fs::File::from_raw_fd(raw_fd) }; std::thread::spawn(move || { write_item_to_pipe( item_path,