Skip to content

Commit

Permalink
Move safety comment outside unsafe block
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Jul 15, 2024
1 parent 3c286d5 commit 1b70afd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion std/src/sys/pal/windows/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ impl Module {
/// This should only be use for modules that exist for the lifetime of std
/// (e.g. kernel32 and ntdll).
pub unsafe fn new(name: &CStr) -> Option<Self> {
// SAFETY: A CStr is always null terminated.
unsafe {
// SAFETY: A CStr is always null terminated.
let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
NonNull::new(module).map(Self)
}
Expand Down

0 comments on commit 1b70afd

Please sign in to comment.