Issue 3223: make unsafe scopes tighter

This commit is contained in:
Alexander McLin
2026-04-04 13:37:42 -04:00
parent fcd6c3f127
commit 83218bf0da
6 changed files with 19 additions and 22 deletions

View File

@@ -386,8 +386,6 @@ impl Atom {
unsafe fn write_to_ptr(string: &str, ptr: *mut u8) {
unsafe {
ptr::write(ptr as *mut _, AtomHeader::build_with(string.len() as u64));
}
unsafe {
let str_ptr = ptr.add(mem::size_of::<AtomHeader>());
ptr::copy_nonoverlapping(string.as_ptr(), str_ptr, string.len());
}