paste: remove unsafe from test code

This commit is contained in:
oech3
2026-04-27 11:34:53 +02:00
committed by Daniel Hofstetter
parent 0d67e58523
commit e8c6c60190
+3 -11
View File
@@ -451,19 +451,11 @@ fn test_paste_non_utf8_paths() {
#[cfg(target_os = "linux")]
fn make_broken_pipe() -> std::fs::File {
use std::os::unix::io::FromRawFd;
let mut fds: [libc::c_int; 2] = [0, 0];
assert_eq!(
unsafe { libc::pipe(fds.as_mut_ptr()) },
0,
"Failed to create pipe"
);
let (read, write) = rustix::pipe::pipe().expect("Failed to create pipe");
// Drop the read end so writes fail with EPIPE.
let _ = unsafe { std::fs::File::from_raw_fd(fds[0]) };
drop(read);
unsafe { std::fs::File::from_raw_fd(fds[1]) }
write.into()
}
#[test]