diff --git a/Cargo.toml b/Cargo.toml index 1580f79..1e6c732 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -146,7 +146,6 @@ cast_sign_loss = "allow" # 4 cast_possible_wrap = "allow" # 4 uninlined_format_args = "allow" # 3 similar_names = "allow" # 3 -ptr_as_ptr = "allow" # 3 used_underscore_binding = "allow" # 2 too_many_lines = "allow" # 2 struct_excessive_bools = "allow" # 2 diff --git a/src/sed/fast_io.rs b/src/sed/fast_io.rs index 5d249e4..dff21b9 100644 --- a/src/sed/fast_io.rs +++ b/src/sed/fast_io.rs @@ -815,8 +815,7 @@ fn reliable_write(fd: i32, ptr: *const u8, len: usize) -> std::io::Result impl Write for FdWriter { fn write(&mut self, buf: &[u8]) -> io::Result { - let ret = - unsafe { libc::write(self.0, buf.as_ptr() as *const libc::c_void, buf.len()) }; + let ret = unsafe { libc::write(self.0, buf.as_ptr().cast(), buf.len()) }; if ret < 0 { Err(io::Error::last_os_error()) } else { @@ -1694,7 +1693,7 @@ mod tests { thread::spawn(move || { let mut buf = [0u8; 1024]; loop { - let n = unsafe { libc::read(read_fd, buf.as_mut_ptr() as *mut _, buf.len()) }; + let n = unsafe { libc::read(read_fd, buf.as_mut_ptr().cast(), buf.len()) }; if n <= 0 { break; }