diff --git a/src/codegen/enums.rs b/src/codegen/enums.rs index 483a468b3..ac2f2cc75 100644 --- a/src/codegen/enums.rs +++ b/src/codegen/enums.rs @@ -427,8 +427,7 @@ impl FromGlib<{sys_crate_name}::{ffi_name}> for {name} {{ doc_alias(w, get_type, "", 1)?; writeln!( w, - " - fn static_type() -> {glib_type} {{ + " fn static_type() -> {glib_type} {{ unsafe {{ from_glib({sys_crate_name}::{get_type}()) }} }} }}", diff --git a/src/codegen/flags.rs b/src/codegen/flags.rs index 066a76555..aa3c758e2 100644 --- a/src/codegen/flags.rs +++ b/src/codegen/flags.rs @@ -265,8 +265,7 @@ impl FromGlib<{sys_crate_name}::{ffi_name}> for {name} {{ doc_alias(w, get_type, "", 1)?; writeln!( w, - " - fn static_type() -> {glib_type} {{ + " fn static_type() -> {glib_type} {{ unsafe {{ from_glib({sys_crate_name}::{get_type}()) }} }} }}",