Add ctype new support
This commit is contained in:
@@ -39,7 +39,7 @@ unsafe impl<T: FromFfi> FromFfi for Option<T> {
|
||||
fn prelude(arg: &str) -> impl Display {
|
||||
let ct = Self::From::name();
|
||||
display!(
|
||||
"if {arg} == nil then {arg} = __cnew(__ctypes.{ct}); else {}{arg} = __cnew(__ctypes.{ct}, 1, {arg}); end; ",
|
||||
"if {arg} == nil then {arg} = __new(__ct.{ct}); else {}{arg} = __new(__ct.{ct}, 1, {arg}); end; ",
|
||||
T::prelude(arg)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user