diff --git a/gdk4/src/dmabuf_texture_builder.rs b/gdk4/src/dmabuf_texture_builder.rs index 1a81f3874220..2e3c7eed5c3b 100644 --- a/gdk4/src/dmabuf_texture_builder.rs +++ b/gdk4/src/dmabuf_texture_builder.rs @@ -34,12 +34,14 @@ impl DmabufTextureBuilder { #[doc(alias = "gdk_dmabuf_texture_builder_build")] #[must_use = "The builder must be built to be used"] #[allow(clippy::missing_safety_doc)] - pub unsafe fn build_with_release_func( + pub unsafe fn build_with_release_func( self, release_func: F, ) -> Result { let mut error = std::ptr::null_mut(); - unsafe extern "C" fn destroy_closure(func: glib::ffi::gpointer) { + unsafe extern "C" fn destroy_closure( + func: glib::ffi::gpointer, + ) { let released_func = Box::::from_raw(func as *mut _); released_func(); } diff --git a/gdk4/src/gl_texture_builder.rs b/gdk4/src/gl_texture_builder.rs index 534385b64ec2..12baf089eac3 100644 --- a/gdk4/src/gl_texture_builder.rs +++ b/gdk4/src/gl_texture_builder.rs @@ -25,8 +25,13 @@ impl GLTextureBuilder { #[doc(alias = "gdk_gl_texture_builder_build")] #[must_use = "The builder must be built to be used"] #[allow(clippy::missing_safety_doc)] - pub unsafe fn build_with_release_func(self, release_func: F) -> Texture { - unsafe extern "C" fn destroy_closure(func: glib::ffi::gpointer) { + pub unsafe fn build_with_release_func( + self, + release_func: F, + ) -> Texture { + unsafe extern "C" fn destroy_closure( + func: glib::ffi::gpointer, + ) { let released_func = Box::::from_raw(func as *mut _); released_func(); }