From db6bad16761d6e92da1e8c6e782d108251d49de9 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Tue, 5 Sep 2017 21:23:17 +0200 Subject: [PATCH] compositor: return value from Token::with_surface_data --- src/compositor/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) } } }