Fix clippy::ptr_offset_with_cast

This commit is contained in:
Zhiming Wang
2020-07-26 01:01:21 +08:00
parent 73b66ea438
commit c9c6031a53
5 changed files with 5 additions and 11 deletions

View File

@ -185,7 +185,7 @@ impl Index<usize> for Buffer {
panic!("out of bounds");
}
unsafe { slice::from_raw_parts(*self.buffer.offset(index as isize), self.size as usize) }
unsafe { slice::from_raw_parts(*self.buffer.add(index), self.size as usize) }
}
}