@@ -410,8 +410,7 @@ fn capture_bitmap_with(
410410#[ cfg ( target_os = "windows" ) ]
411411fn bgra_to_rgb( buffer: Vec <u8>, width: usize, height: usize ) -> anyhow:: Result <RgbImage > {
412412 let stride = width. checked_mul ( 4 ) . ok_or_else ( unsupported_error) ?;
413- rgb_from_rgba ( & buffer, width, height, stride, ChannelOrder :: Bgra )
414- . ok_or_else ( || unsupported_error ( ) )
413+ rgb_from_rgba ( & buffer, width, height, stride, ChannelOrder :: Bgra ) . ok_or_else ( unsupported_error)
415414}
416415
417416#[ cfg ( target_os = "windows" ) ]
@@ -500,22 +499,22 @@ fn capture_window_print(hwnd: HWND, width: i32, height: i32) -> anyhow::Result<V
500499fn capture_screenshot_fallback( target: ScreenCaptureTarget ) -> anyhow:: Result <RgbImage > {
501500 match target {
502501 ScreenCaptureTarget :: Display { id } => {
503- let display = scap_targets:: Display :: from_id ( & id) . ok_or_else ( || unsupported_error ( ) ) ?;
502+ let display = scap_targets:: Display :: from_id ( & id) . ok_or_else ( unsupported_error) ?;
504503 let bounds = display
505504 . raw_handle ( )
506505 . physical_bounds ( )
507- . ok_or_else ( || unsupported_error ( ) ) ?;
506+ . ok_or_else ( unsupported_error) ?;
508507
509508 let image = capture_display_bounds ( bounds) ?;
510509 debug ! ( "Windows GDI display capture" ) ;
511510 Ok ( image)
512511 }
513512 ScreenCaptureTarget :: Window { id } => {
514- let window = scap_targets:: Window :: from_id ( & id) . ok_or_else ( || unsupported_error ( ) ) ?;
513+ let window = scap_targets:: Window :: from_id ( & id) . ok_or_else ( unsupported_error) ?;
515514 let bounds = window
516515 . raw_handle ( )
517516 . physical_bounds ( )
518- . ok_or_else ( || unsupported_error ( ) ) ?;
517+ . ok_or_else ( unsupported_error) ?;
519518
520519 let width = bounds. size ( ) . width ( ) . round ( ) as i32 ;
521520 let height = bounds. size ( ) . height ( ) . round ( ) as i32 ;
@@ -534,12 +533,11 @@ fn capture_screenshot_fallback(target: ScreenCaptureTarget) -> anyhow::Result<Rg
534533 Ok ( image)
535534 }
536535 ScreenCaptureTarget :: Area { screen, .. } => {
537- let display =
538- scap_targets:: Display :: from_id ( & screen) . ok_or_else ( || unsupported_error ( ) ) ?;
536+ let display = scap_targets:: Display :: from_id ( & screen) . ok_or_else ( unsupported_error) ?;
539537 let bounds = display
540538 . raw_handle ( )
541539 . physical_bounds ( )
542- . ok_or_else ( || unsupported_error ( ) ) ?;
540+ . ok_or_else ( unsupported_error) ?;
543541
544542 let image = capture_display_bounds ( bounds) ?;
545543 debug ! ( "Windows GDI area capture" ) ;
0 commit comments