@@ -45,12 +45,11 @@ impl<D: HasDisplayHandle + ?Sized> ContextInterface<D> for Arc<WaylandDisplayImp
4545 D : Sized ,
4646 {
4747 let raw = display. display_handle ( ) ?. as_raw ( ) ;
48- let wayland_handle = match raw {
49- RawDisplayHandle :: Wayland ( w) => w. display ,
50- _ => return Err ( InitError :: Unsupported ( display) ) ,
48+ let RawDisplayHandle :: Wayland ( w) = raw else {
49+ return Err ( InitError :: Unsupported ( display) ) ;
5150 } ;
5251
53- let backend = unsafe { Backend :: from_foreign_display ( wayland_handle . as_ptr ( ) . cast ( ) ) } ;
52+ let backend = unsafe { Backend :: from_foreign_display ( w . display . as_ptr ( ) . cast ( ) ) } ;
5453 let conn = Connection :: from_backend ( backend) ;
5554 let ( globals, event_queue) =
5655 registry_queue_init ( & conn) . swbuf_err ( "Failed to make round trip to server" ) ?;
@@ -159,15 +158,14 @@ impl<D: HasDisplayHandle + ?Sized, W: HasWindowHandle> SurfaceInterface<D, W>
159158 fn new ( window : W , display : & Arc < WaylandDisplayImpl < D > > ) -> Result < Self , InitError < W > > {
160159 // Get the raw Wayland window.
161160 let raw = window. window_handle ( ) ?. as_raw ( ) ;
162- let wayland_handle = match raw {
163- RawWindowHandle :: Wayland ( w) => w. surface ,
164- _ => return Err ( InitError :: Unsupported ( window) ) ,
161+ let RawWindowHandle :: Wayland ( w) = raw else {
162+ return Err ( InitError :: Unsupported ( window) ) ;
165163 } ;
166164
167165 let surface_id = unsafe {
168166 ObjectId :: from_ptr (
169167 wl_surface:: WlSurface :: interface ( ) ,
170- wayland_handle . as_ptr ( ) . cast ( ) ,
168+ w . surface . as_ptr ( ) . cast ( ) ,
171169 )
172170 }
173171 . swbuf_err ( "Failed to create proxy for surface ID." ) ?;
0 commit comments