@@ -43,26 +43,24 @@ impl Plugin for EasyScreenshotPlugin {
4343 let format = self . format ;
4444 app. add_systems (
4545 Update ,
46- ( || {
47- move |mut commands : Commands , window : Single < & Window , With < PrimaryWindow > > | {
48- let since_the_epoch = SystemTime :: now ( )
49- . duration_since ( UNIX_EPOCH )
50- . expect ( "time should go forward" ) ;
46+ ( move |mut commands : Commands , window : Single < & Window , With < PrimaryWindow > > | {
47+ let since_the_epoch = SystemTime :: now ( )
48+ . duration_since ( UNIX_EPOCH )
49+ . expect ( "time should go forward" ) ;
5150
52- commands
53- . spawn ( Screenshot :: primary_window ( ) )
54- . observe ( save_to_disk ( format ! (
55- "{}-{}.{}" ,
56- window. title,
57- since_the_epoch. as_millis( ) ,
58- match format {
59- ScreenshotFormat :: Jpeg => "jpg" ,
60- ScreenshotFormat :: Png => "png" ,
61- ScreenshotFormat :: Bmp => "bmp" ,
62- }
63- ) ) ) ;
64- }
65- } ) ( )
51+ commands
52+ . spawn ( Screenshot :: primary_window ( ) )
53+ . observe ( save_to_disk ( format ! (
54+ "{}-{}.{}" ,
55+ window. title,
56+ since_the_epoch. as_millis( ) ,
57+ match format {
58+ ScreenshotFormat :: Jpeg => "jpg" ,
59+ ScreenshotFormat :: Png => "png" ,
60+ ScreenshotFormat :: Bmp => "bmp" ,
61+ }
62+ ) ) ) ;
63+ } )
6664 . run_if ( input_just_pressed ( self . trigger ) ) ,
6765 ) ;
6866 }
0 commit comments