File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ mod _locale {
308308 {
309309 // On Windows, use GetACP() to get the ANSI code page
310310 let acp = unsafe { GetACP ( ) } ;
311- format ! ( "cp{}" , acp )
311+ format ! ( "cp{acp}" )
312312 }
313313 #[ cfg( not( windows) ) ]
314314 {
Original file line number Diff line number Diff line change @@ -579,7 +579,7 @@ mod mmap {
579579 let handle = unsafe { suppress_iph ! ( libc:: get_osfhandle( fileno) ) } ;
580580 // Check for invalid handle value (-1 on Windows)
581581 if handle == -1 || handle == INVALID_HANDLE_VALUE as isize {
582- return Err ( vm. new_os_error ( format ! ( "Invalid file descriptor: {}" , fileno ) ) ) ;
582+ return Err ( vm. new_os_error ( format ! ( "Invalid file descriptor: {fileno}" ) ) ) ;
583583 }
584584 Some ( handle as HANDLE )
585585 } else {
Original file line number Diff line number Diff line change @@ -1555,13 +1555,11 @@ mod _overlapped {
15551555 ERROR_SUCCESS | ERROR_NOT_FOUND | ERROR_OPERATION_ABORTED => { }
15561556 _ => {
15571557 let msg = format ! (
1558- "{:?} still has pending operation at deallocation, the process may crash" ,
1559- zelf
1558+ "{zelf:?} still has pending operation at deallocation, the process may crash"
15601559 ) ;
15611560 let exc = vm. new_runtime_error ( msg) ;
15621561 let err_msg = Some ( format ! (
1563- "Exception ignored while deallocating overlapped operation {:?}" ,
1564- zelf
1562+ "Exception ignored while deallocating overlapped operation {zelf:?}"
15651563 ) ) ;
15661564 let obj: PyObjectRef = zelf. to_owned ( ) . into ( ) ;
15671565 vm. run_unraisable ( exc, err_msg, obj) ;
@@ -1656,9 +1654,8 @@ mod _overlapped {
16561654 if overlapped. is_null ( ) {
16571655 if err == Foundation :: WAIT_TIMEOUT {
16581656 return Ok ( vm. ctx . none ( ) ) ;
1659- } else {
1660- return Err ( set_from_windows_err ( err, vm) ) ;
16611657 }
1658+ return Err ( set_from_windows_err ( err, vm) ) ;
16621659 }
16631660
16641661 let value = vm. ctx . new_tuple ( vec ! [
Original file line number Diff line number Diff line change @@ -1492,8 +1492,7 @@ mod _socket {
14921492 if bytes_data. len ( ) != expected_size {
14931493 return Err ( vm
14941494 . new_value_error ( format ! (
1495- "socket descriptor string has wrong size, should be {} bytes" ,
1496- expected_size
1495+ "socket descriptor string has wrong size, should be {expected_size} bytes"
14971496 ) )
14981497 . into ( ) ) ;
14991498 }
@@ -2393,7 +2392,7 @@ mod _socket {
23932392 let cmd_val = cmd_int. as_bigint ( ) ;
23942393 let cmd: u32 = cmd_val
23952394 . to_u32 ( )
2396- . ok_or_else ( || vm. new_value_error ( format ! ( "invalid ioctl command {}" , cmd_val ) ) ) ?;
2395+ . ok_or_else ( || vm. new_value_error ( format ! ( "invalid ioctl command {cmd_val}" ) ) ) ?;
23972396
23982397 match cmd {
23992398 c:: SIO_RCVALL | c:: SIO_LOOPBACK_FAST_PATH => {
@@ -2466,7 +2465,7 @@ mod _socket {
24662465 Ok ( recv)
24672466 }
24682467 _ => Err ( vm
2469- . new_value_error ( format ! ( "invalid ioctl command {}" , cmd ) )
2468+ . new_value_error ( format ! ( "invalid ioctl command {cmd}" ) )
24702469 . into ( ) ) ,
24712470 }
24722471 }
Original file line number Diff line number Diff line change @@ -4947,8 +4947,7 @@ mod _ssl {
49474947 // If no stores could be opened, raise OSError
49484948 if stores. is_empty ( ) {
49494949 return Err ( vm. new_os_error ( format ! (
4950- "failed to open certificate store {:?}" ,
4951- store_name_str
4950+ "failed to open certificate store {store_name_str:?}"
49524951 ) ) ) ;
49534952 }
49544953
@@ -5000,8 +4999,7 @@ mod _ssl {
50004999
50015000 if store. is_null ( ) {
50025001 return Err ( vm. new_os_error ( format ! (
5003- "failed to open certificate store {:?}" ,
5004- store_name_str
5002+ "failed to open certificate store {store_name_str:?}"
50055003 ) ) ) ;
50065004 }
50075005
You can’t perform that action at this time.
0 commit comments