Skip to content

Commit c5304ff

Browse files
committed
Format
1 parent 475df91 commit c5304ff

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

library/std/src/sys/windows/alloc.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,18 @@ unsafe impl GlobalAlloc for System {
7171
c::HeapFree(c::GetProcessHeap(), 0, header.0 as c::LPVOID)
7272
}
7373
};
74-
debug_assert!(err != 0, "Failed to free heap memory: {}", unsafe {c::GetLastError()});
74+
debug_assert!(err != 0, "Failed to free heap memory: {}", unsafe { c::GetLastError() });
7575
}
7676

7777
#[inline]
7878
unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
7979
if layout.align() <= MIN_ALIGN {
8080
// SAFETY: HeapReAlloc is safe if ptr was allocated by this allocator
8181
// and new_size is not 0.
82-
unsafe {
83-
c::HeapReAlloc(c::GetProcessHeap(), 0, ptr as c::LPVOID, new_size) as *mut u8
84-
}
82+
unsafe { c::HeapReAlloc(c::GetProcessHeap(), 0, ptr as c::LPVOID, new_size) as *mut u8 }
8583
} else {
8684
// SAFETY: The safety contract for `realloc_fallback` must be upheld by the caller
87-
unsafe {
88-
realloc_fallback(self, ptr, layout, new_size)
89-
}
85+
unsafe { realloc_fallback(self, ptr, layout, new_size) }
9086
}
9187
}
9288
}

0 commit comments

Comments
 (0)