diff options
| author | kennytm <kennytm@gmail.com> | 2018-08-21 22:05:30 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-08-21 22:05:30 +0800 |
| commit | 0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67 (patch) | |
| tree | 0ad62b121fcafe2d11ee95819caf64e975d4ad00 /src/libstd/sys | |
| parent | 9bbab65ebefbeb512445a759603b03f858e5e9b9 (diff) | |
| parent | 993fb934640b7e514f3c629c33a2698a83ed8c3e (diff) | |
| download | rust-0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67.tar.gz rust-0dd88c97975b2a2e4ea3e4a2bdc3670a9f40bd67.zip | |
Rollup merge of #53329 - frewsxcv:frewsxcv-ptr-add-sub, r=RalfJung
Replace usages of ptr::offset with ptr::{add,sub}.
Rust provides these helper methods – so let's use them!
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/windows/pipe.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index df1dd7401af..4b19519a57a 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -359,6 +359,6 @@ unsafe fn slice_to_end(v: &mut Vec<u8>) -> &mut [u8] { if v.capacity() == v.len() { v.reserve(1); } - slice::from_raw_parts_mut(v.as_mut_ptr().offset(v.len() as isize), + slice::from_raw_parts_mut(v.as_mut_ptr().add(v.len()), v.capacity() - v.len()) } |
