@@ -179,7 +179,7 @@ impl ActivationHandler for AppData {
179
179
fn new_token ( & mut self , token : String , data : & ExecRequestData ) {
180
180
let _ = self . tx . unbounded_send ( WaylandUpdate :: ActivationToken {
181
181
token : Some ( token) ,
182
- app_id : data. app_id ( ) . map ( |x| x . to_owned ( ) ) ,
182
+ app_id : data. app_id ( ) . map ( String :: from ) ,
183
183
exec : data. exec . clone ( ) ,
184
184
gpu_idx : data. gpu_idx ,
185
185
terminal : data. terminal ,
@@ -313,7 +313,10 @@ impl Session {
313
313
self . condvar . notify_all ( ) ;
314
314
}
315
315
316
- fn wait_while < F : FnMut ( & SessionInner ) -> bool > ( & self , mut f : F ) -> MutexGuard < SessionInner > {
316
+ fn wait_while < F : FnMut ( & SessionInner ) -> bool > (
317
+ & self ,
318
+ mut f : F ,
319
+ ) -> MutexGuard < ' _ , SessionInner > {
317
320
self . condvar
318
321
. wait_while ( self . inner . lock ( ) . unwrap ( ) , |data| f ( data) )
319
322
. unwrap ( )
@@ -337,7 +340,7 @@ impl Dispatch<wl_shm_pool::WlShmPool, ()> for AppData {
337
340
_app_data : & mut Self ,
338
341
_buffer : & wl_shm_pool:: WlShmPool ,
339
342
_event : wl_shm_pool:: Event ,
340
- _ : & ( ) ,
343
+ ( ) : & ( ) ,
341
344
_: & Connection ,
342
345
_qh : & QueueHandle < Self > ,
343
346
) {
@@ -349,7 +352,7 @@ impl Dispatch<wl_buffer::WlBuffer, ()> for AppData {
349
352
_app_data : & mut Self ,
350
353
_buffer : & wl_buffer:: WlBuffer ,
351
354
_event : wl_buffer:: Event ,
352
- _ : & ( ) ,
355
+ ( ) : & ( ) ,
353
356
_: & Connection ,
354
357
_qh : & QueueHandle < Self > ,
355
358
) {
@@ -387,7 +390,7 @@ impl CaptureData {
387
390
& self . qh ,
388
391
SessionData {
389
392
session : session. clone ( ) ,
390
- session_data : Default :: default ( ) ,
393
+ session_data : ScreencopySessionData :: default ( ) ,
391
394
} ,
392
395
)
393
396
. unwrap ( ) ;
@@ -405,22 +408,19 @@ impl CaptureData {
405
408
}
406
409
407
410
// XXX
408
- if !formats
409
- . shm_formats
410
- . contains ( & wl_shm:: Format :: Abgr8888 . into ( ) )
411
- {
411
+ if !formats. shm_formats . contains ( & wl_shm:: Format :: Abgr8888 ) {
412
412
tracing:: error!( "No suitable buffer format found" ) ;
413
413
tracing:: warn!( "Available formats: {:#?}" , formats) ;
414
414
return None ;
415
- } ;
415
+ }
416
416
417
417
let buf_len = width * height * 4 ;
418
418
if let Some ( len) = len {
419
419
if len != buf_len {
420
420
return None ;
421
421
}
422
- } else if let Err ( _err) = rustix:: fs:: ftruncate ( & fd, buf_len as _ ) {
423
- } ;
422
+ } else if let Err ( _err) = rustix:: fs:: ftruncate ( & fd, buf_len. into ( ) ) {
423
+ }
424
424
let pool = self
425
425
. wl_shm
426
426
. create_pool ( fd. as_fd ( ) , buf_len as i32 , & self . qh , ( ) ) ;
@@ -439,7 +439,7 @@ impl CaptureData {
439
439
& [ ] ,
440
440
& self . qh ,
441
441
FrameData {
442
- frame_data : Default :: default ( ) ,
442
+ frame_data : ScreencopyFrameData :: default ( ) ,
443
443
session : capture_session. clone ( ) ,
444
444
} ,
445
445
) ;
@@ -484,7 +484,7 @@ impl AppData {
484
484
handle : & ExtForeignToplevelHandleV1 ,
485
485
) -> Option < ZcosmicToplevelHandleV1 > {
486
486
self . toplevel_info_state
487
- . info ( & handle) ?
487
+ . info ( handle) ?
488
488
. cosmic_toplevel
489
489
. clone ( )
490
490
}
@@ -498,8 +498,7 @@ impl AppData {
498
498
capturer : self . screencopy_state . capturer ( ) . clone ( ) ,
499
499
} ;
500
500
std:: thread:: spawn ( move || {
501
- use std:: ffi:: CStr ;
502
- let name = unsafe { CStr :: from_bytes_with_nul_unchecked ( b"app-list-screencopy\0 " ) } ;
501
+ let name = c"app-list-screencopy" ;
503
502
let Ok ( fd) = rustix:: fs:: memfd_create ( name, rustix:: fs:: MemfdFlags :: CLOEXEC ) else {
504
503
tracing:: error!( "Failed to get fd for capture" ) ;
505
504
return ;
@@ -535,7 +534,7 @@ impl AppData {
535
534
tx. unbounded_send ( WaylandUpdate :: Image ( handle, WaylandImage :: new ( img) ) )
536
535
{
537
536
tracing:: error!( "Failed to send image event to subscription {err:?}" ) ;
538
- } ;
537
+ }
539
538
} else {
540
539
tracing:: error!( "Failed to capture image" ) ;
541
540
}
@@ -624,7 +623,7 @@ pub(crate) fn wayland_handler(
624
623
. expect ( "Failed to insert wayland source." ) ;
625
624
626
625
if handle
627
- . insert_source ( rx, |event, _ , state| match event {
626
+ . insert_source ( rx, |event, ( ) , state| match event {
628
627
calloop:: channel:: Event :: Msg ( req) => match req {
629
628
WaylandRequest :: Screencopy ( handle) => {
630
629
state. send_image ( handle. clone ( ) ) ;
0 commit comments