@@ -774,7 +774,7 @@ fn session_find_objects() -> testresult::TestResult {
774
774
let key_template = vec ! [
775
775
Attribute :: Token ( true ) ,
776
776
Attribute :: Encrypt ( true ) ,
777
- Attribute :: Label ( format!( "key_{}" , i ) . as_bytes( ) . to_vec( ) ) ,
777
+ Attribute :: Label ( format!( "key_{i}" ) . as_bytes( ) . to_vec( ) ) ,
778
778
Attribute :: ValueLen ( 32 . into( ) ) ,
779
779
Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
780
780
] ;
@@ -826,7 +826,7 @@ fn session_objecthandle_iterator() -> testresult::TestResult {
826
826
Attribute :: Token ( true ) ,
827
827
Attribute :: Encrypt ( true ) ,
828
828
Attribute :: ValueLen ( 32 . into( ) ) ,
829
- Attribute :: Label ( format!( "key_{}" , i ) . as_bytes( ) . to_vec( ) ) ,
829
+ Attribute :: Label ( format!( "key_{i}" ) . as_bytes( ) . to_vec( ) ) ,
830
830
Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
831
831
] ;
832
832
@@ -1000,27 +1000,27 @@ fn login_feast() {
1000
1000
let session = pkcs11. open_rw_session ( slot) . unwrap ( ) ;
1001
1001
match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
1002
1002
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1003
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1003
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1004
1004
}
1005
1005
match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
1006
1006
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1007
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1007
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1008
1008
}
1009
1009
match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
1010
1010
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1011
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1011
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1012
1012
}
1013
1013
match session. logout ( ) {
1014
1014
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1015
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1015
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1016
1016
}
1017
1017
match session. logout ( ) {
1018
1018
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1019
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1019
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1020
1020
}
1021
1021
match session. logout ( ) {
1022
1022
Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1023
- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1023
+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
1024
1024
}
1025
1025
} ) ) ;
1026
1026
}
@@ -1317,7 +1317,7 @@ fn is_initialized_test() {
1317
1317
1318
1318
match pkcs11. initialize ( CInitializeArgs :: OsThreads ) {
1319
1319
Err ( Error :: AlreadyInitialized ) => ( ) ,
1320
- Err ( e) => panic ! ( "Got unexpected error when initializing: {}" , e ) ,
1320
+ Err ( e) => panic ! ( "Got unexpected error when initializing: {e}" ) ,
1321
1321
Ok ( ( ) ) => panic ! ( "Initializing twice should not have been allowed" ) ,
1322
1322
}
1323
1323
}
@@ -1429,7 +1429,7 @@ fn ro_rw_session_test() -> TestResult {
1429
1429
if let Error :: Pkcs11 ( RvError :: SessionReadOnly , _f) = e {
1430
1430
// as expected
1431
1431
} else {
1432
- panic ! ( "Got wrong error code (expecting SessionReadOnly): {}" , e ) ;
1432
+ panic ! ( "Got wrong error code (expecting SessionReadOnly): {e}" ) ;
1433
1433
}
1434
1434
ro_session. logout ( ) ?;
1435
1435
}
@@ -2075,8 +2075,7 @@ fn wait_for_slot_event() {
2075
2075
Function :: WaitForSlotEvent
2076
2076
) )
2077
2077
) ,
2078
- "res = {:?}" ,
2079
- res
2078
+ "res = {res:?}"
2080
2079
) ;
2081
2080
}
2082
2081
0 commit comments