Skip to content

Commit e4b39d6

Browse files
committed
Use MaybeUninit for string
1 parent 75e3479 commit e4b39d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phper/src/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use sealed::sealed;
3232
use std::{
3333
ffi::{CStr, CString},
3434
marker::PhantomData,
35-
mem::zeroed,
35+
mem::{MaybeUninit, zeroed},
3636
ptr::null_mut,
3737
rc::Rc,
3838
};
@@ -287,7 +287,7 @@ unsafe fn register_enum_case(
287287
value.len().try_into().unwrap(),
288288
true.into(),
289289
);
290-
let mut value = ZVal::from(());
290+
let mut value = MaybeUninit::<zval>::uninit();
291291
phper_zval_str(value.as_mut_ptr(), value_ptr);
292292

293293
zend_enum_add_case_cstr(class_ce, case_name.as_ptr(), value.as_mut_ptr());

0 commit comments

Comments
 (0)