fix: add FromRawFd import and use it to create File instances

This commit is contained in:
Andrew Phillips (aider)
2025-05-06 11:07:29 -03:00
parent 3cd7f1c2a8
commit 2fb50fca48

View File

@@ -5,6 +5,7 @@ use std::str::FromStr;
use std::path::PathBuf; use std::path::PathBuf;
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
use std::os::fd::FromRawFd;
use regex::Regex; use regex::Regex;
@@ -529,8 +530,8 @@ fn mode_diff(cmd: &mut Command, args: Args, ids: &mut Vec<i64>, tags: &mut Vec<S
.spawn() .spawn()
.expect("Failed to execute diff command"); .expect("Failed to execute diff command");
let mut stdout_a = unsafe { std::fs::File::from_raw_fd(fd_a_write) }; let stdout_a = unsafe { std::fs::File::from_raw_fd(fd_a_write) };
let mut stdout_b = unsafe { std::fs::File::from_raw_fd(fd_b_write) }; let stdout_b = unsafe { std::fs::File::from_raw_fd(fd_b_write) };
compression_engine_a.cat(item_path_a.clone())?; compression_engine_a.cat(item_path_a.clone())?;
compression_engine_b.cat(item_path_b.clone())?; compression_engine_b.cat(item_path_b.clone())?;