windows: resolve clippy::unnecessary_cast warnings

Change-Id: I07a6c2b2a737721baa202bd41acdc6f3aff4d7bc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5241879
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
This commit is contained in:
Daniel Verkamp 2024-01-26 14:48:48 -08:00 committed by crosvm LUCI
parent 659977977d
commit e9e933ff6f
2 changed files with 2 additions and 6 deletions

View file

@ -38,11 +38,7 @@ pub fn set_sparse_file<T: AsRawDescriptor>(handle: &T) -> io::Result<()> {
// Safe because we check the return value and handle is guaranteed to be a
// valid file handle by the caller.
let result = unsafe {
super::ioctl::ioctl_with_ptr(
handle,
FSCTL_SET_SPARSE,
std::ptr::null_mut() as *mut c_void,
)
super::ioctl::ioctl_with_ptr(handle, FSCTL_SET_SPARSE, std::ptr::null_mut::<c_void>())
};
if result != 0 {
return Err(io::Error::from_raw_os_error(result));

View file

@ -300,7 +300,7 @@ fn poll_sockets(mut sockets: Vec<WSAPOLLFD>) -> io::Result<Vec<WSAPOLLFD>> {
// Safe because sockets is guaranteed to be valid, and we handle error return codes below.
let poll_result = unsafe {
WSAPoll(
sockets.as_mut_ptr() as *mut WSAPOLLFD,
sockets.as_mut_ptr(),
sockets.len() as u32,
1, /* timeout in ms */
)