From 09ace3529529e9c1b1509dae69b609b02a23b3a7 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 13 Aug 2019 19:17:27 -0700 Subject: [PATCH] Clippy: use ptr::add rather than ptr::offset. --- src/sys/unix/hostcalls_impl/fs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sys/unix/hostcalls_impl/fs.rs b/src/sys/unix/hostcalls_impl/fs.rs index bbdc3f5f82..a729da512e 100644 --- a/src/sys/unix/hostcalls_impl/fs.rs +++ b/src/sys/unix/hostcalls_impl/fs.rs @@ -251,15 +251,15 @@ pub(crate) fn fd_readdir( break; } unsafe { - let ptr = host_buf_ptr.offset(host_buf_offset as isize) as *mut c_void - as *mut host::__wasi_dirent_t; + let ptr = + host_buf_ptr.add(host_buf_offset) as *mut c_void as *mut host::__wasi_dirent_t; *ptr = entry; } host_buf_offset += std::mem::size_of_val(&entry); let name_ptr = unsafe { *host_entry }.d_name.as_ptr(); unsafe { memcpy( - host_buf_ptr.offset(host_buf_offset as isize) as *mut _, + host_buf_ptr.add(host_buf_offset) as *mut _, name_ptr as *const _, name_len, )