diff --git a/src/compositor/mod.rs b/src/compositor/mod.rs index af9582b..77d11b0 100644 --- a/src/compositor/mod.rs +++ b/src/compositor/mod.rs @@ -287,17 +287,15 @@ impl + Send + 'static> Co /// /// If the surface is not managed by the CompositorGlobal that provided this token, this /// will panic (having more than one compositor is not supported). - pub fn with_surface_data(&self, surface: &wl_surface::WlSurface, f: F) + pub fn with_surface_data(&self, surface: &wl_surface::WlSurface, f: F) -> T where - F: FnOnce(&mut SurfaceAttributes), + F: FnOnce(&mut SurfaceAttributes) -> T, { assert!( resource_is_registered::<_, CompositorHandler>(surface, self.hid), "Accessing the data of foreign surfaces is not supported." ); - unsafe { - SurfaceData::::with_data(surface, f); - } + unsafe { SurfaceData::::with_data(surface, f) } } }