Remove some unneeded casts

This commit is contained in:
Simon Sapin 2018-05-30 21:04:17 +02:00
parent 11f992c958
commit 0081d8826b
2 changed files with 5 additions and 5 deletions

View file

@ -64,7 +64,7 @@ unsafe fn test_triangle() -> bool {
println!("deallocate({:?}, {:?}", ptr, layout);
}
Global.dealloc(NonNull::new_unchecked(ptr).cast(), layout);
Global.dealloc(NonNull::new_unchecked(ptr), layout);
}
unsafe fn reallocate(ptr: *mut u8, old: Layout, new: Layout) -> *mut u8 {
@ -72,7 +72,7 @@ unsafe fn test_triangle() -> bool {
println!("reallocate({:?}, old={:?}, new={:?})", ptr, old, new);
}
let ret = Global.realloc(NonNull::new_unchecked(ptr).cast(), old, new.size())
let ret = Global.realloc(NonNull::new_unchecked(ptr), old, new.size())
.unwrap_or_else(|_| oom(Layout::from_size_align_unchecked(new.size(), old.align())));
if PRINT {