@@ -21,7 +21,9 @@ type Result<T> = std::result::Result<T, Error>;
2121lazy_static ! {
2222 static ref PID_FILE : PathBuf = {
2323 let pid = std:: process:: id( ) ;
24- std:: env:: temp_dir( ) . join( format!( "{TEMP_FILENAME}.{pid}" ) ) . into( )
24+ std:: env:: temp_dir( )
25+ . join( format!( "{TEMP_FILENAME}.{pid}" ) )
26+ . into( )
2527 } ;
2628}
2729
@@ -49,14 +51,10 @@ fn launch_splash() -> Result<()> {
4951 . collect ( ) ;
5052 let current_monitor = WinitWindow :: new ( & EventLoop :: new ( ) ) ?
5153 . current_monitor ( )
52- . ok_or_else ( ||{
53- Into :: < Error > :: into ( String :: from ( "could not get current monitor" ) )
54- } ) ?;
54+ . ok_or_else ( || Into :: < Error > :: into ( String :: from ( "could not get current monitor" ) ) ) ?;
5555 let size = current_monitor. size ( ) ;
56- let pos_x = ( ( size. width as f64 - image. width ( ) as f64 ) / 2.0 )
57- as isize ;
58- let pos_y = ( ( size. height as f64 - image. height ( ) as f64 )
59- / 2.0 ) as isize ;
56+ let pos_x = ( ( size. width as f64 - image. width ( ) as f64 ) / 2.0 ) as isize ;
57+ let pos_y = ( ( size. height as f64 - image. height ( ) as f64 ) / 2.0 ) as isize ;
6058
6159 let mut window = Window :: new (
6260 "" ,
@@ -74,8 +72,7 @@ fn launch_splash() -> Result<()> {
7472 let temp_filename = create_temp_file ( ) ?;
7573 let now = Instant :: now ( ) ;
7674 while window. is_open ( ) && now. elapsed ( ) < TIMEOUT_DURATION && temp_filename. exists ( ) {
77- window
78- . update_with_buffer ( & u32_buffer, image. width ( ) as usize , image. height ( ) as usize ) ?;
75+ window. update_with_buffer ( & u32_buffer, image. width ( ) as usize , image. height ( ) as usize ) ?;
7976 window. set_position ( pos_x, pos_y) ;
8077 }
8178
0 commit comments