Update to use newer Rust features.
This re-introduces several cleanups that we previously deferred for not supporting Rust 1.25.
This commit is contained in:
@@ -100,7 +100,7 @@ impl Memory {
|
||||
pub fn allocate(&mut self, size: usize) -> Result<*mut u8, String> {
|
||||
if size <= self.current.len - self.position {
|
||||
// TODO: Ensure overflow is not possible.
|
||||
let ptr = unsafe { self.current.ptr.offset(self.position as isize) };
|
||||
let ptr = unsafe { self.current.ptr.add(self.position) };
|
||||
self.position += size;
|
||||
return Ok(ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user