We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01eb50f commit 08adb0cCopy full SHA for 08adb0c
src/interpreter/data.rs
@@ -27,12 +27,12 @@ impl Value {
27
// TODO The constants should probably be alloced in the chunk's constants, not 'anywhere'.
28
pub unsafe fn string_to_ptr(string: &String) -> *mut () {
29
let data = alloc(Layout::new::<String>());
30
- *(data as *mut String) = string.clone();
+ std::ptr::write(data as *mut String, string.clone());
31
transmute(data)
32
}
33
34
pub unsafe fn uuid_to_ptr(uuid: Uuid) -> *mut () {
35
let data = alloc(Layout::new::<Uuid>());
36
- *(data as *mut Uuid) = uuid;
+ std::ptr::write(data as *mut Uuid, uuid.clone());
37
38
0 commit comments