Move safety comment outside unsafe block
This commit is contained in:
parent
3411a025d5
commit
7e16d5fb61
@ -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> {
|
||||
unsafe {
|
||||
// SAFETY: A CStr is always null terminated.
|
||||
unsafe {
|
||||
let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
|
||||
NonNull::new(module).map(Self)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user