Skip to content

Commit 1b70afd

Browse files
committed
Move safety comment outside unsafe block
1 parent 3c286d5 commit 1b70afd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

std/src/sys/pal/windows/compat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ impl Module {
111111
/// This should only be use for modules that exist for the lifetime of std
112112
/// (e.g. kernel32 and ntdll).
113113
pub unsafe fn new(name: &CStr) -> Option<Self> {
114+
// SAFETY: A CStr is always null terminated.
114115
unsafe {
115-
// SAFETY: A CStr is always null terminated.
116116
let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
117117
NonNull::new(module).map(Self)
118118
}

0 commit comments

Comments
 (0)