clippy: fix ptr_as_ptr lint

https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
This commit is contained in:
xtqqczze
2025-12-18 00:19:14 +00:00
parent c9268934c0
commit 70fd10d335
5 changed files with 12 additions and 18 deletions
+2 -7
View File
@@ -193,13 +193,8 @@ fn read_from_fd(fd: RawFd) -> String {
let mut captured_output = Vec::new();
let mut read_buffer = [0; 1024];
loop {
let bytes_read = unsafe {
libc::read(
fd,
read_buffer.as_mut_ptr() as *mut libc::c_void,
read_buffer.len(),
)
};
let bytes_read =
unsafe { libc::read(fd, read_buffer.as_mut_ptr().cast(), read_buffer.len()) };
if bytes_read == -1 {
eprintln!("Failed to read from the pipe");