@@ -862,7 +862,7 @@ fn session_find_objects() -> testresult::TestResult {
862862 let key_template = vec ! [
863863 Attribute :: Token ( true ) ,
864864 Attribute :: Encrypt ( true ) ,
865- Attribute :: Label ( format!( "key_{}" , i ) . as_bytes( ) . to_vec( ) ) ,
865+ Attribute :: Label ( format!( "key_{i}" ) . as_bytes( ) . to_vec( ) ) ,
866866 Attribute :: ValueLen ( 32 . into( ) ) ,
867867 Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
868868 ] ;
@@ -914,7 +914,7 @@ fn session_objecthandle_iterator() -> testresult::TestResult {
914914 Attribute :: Token ( true ) ,
915915 Attribute :: Encrypt ( true ) ,
916916 Attribute :: ValueLen ( 32 . into( ) ) ,
917- Attribute :: Label ( format!( "key_{}" , i ) . as_bytes( ) . to_vec( ) ) ,
917+ Attribute :: Label ( format!( "key_{i}" ) . as_bytes( ) . to_vec( ) ) ,
918918 Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
919919 ] ;
920920
@@ -1088,27 +1088,27 @@ fn login_feast() {
10881088 let session = pkcs11. open_rw_session ( slot) . unwrap ( ) ;
10891089 match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
10901090 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1091- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1091+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
10921092 }
10931093 match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
10941094 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1095- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1095+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
10961096 }
10971097 match session. login ( UserType :: User , Some ( & AuthPin :: new ( USER_PIN . into ( ) ) ) ) {
10981098 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserAlreadyLoggedIn , Function :: Login ) ) => { }
1099- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1099+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
11001100 }
11011101 match session. logout ( ) {
11021102 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1103- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1103+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
11041104 }
11051105 match session. logout ( ) {
11061106 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1107- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1107+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
11081108 }
11091109 match session. logout ( ) {
11101110 Ok ( _) | Err ( Error :: Pkcs11 ( RvError :: UserNotLoggedIn , Function :: Logout ) ) => { }
1111- Err ( e) => panic ! ( "Bad error response: {}" , e ) ,
1111+ Err ( e) => panic ! ( "Bad error response: {e}" ) ,
11121112 }
11131113 } ) ) ;
11141114 }
@@ -1405,7 +1405,7 @@ fn is_initialized_test() {
14051405
14061406 match pkcs11. initialize ( CInitializeArgs :: OsThreads ) {
14071407 Err ( Error :: AlreadyInitialized ) => ( ) ,
1408- Err ( e) => panic ! ( "Got unexpected error when initializing: {}" , e ) ,
1408+ Err ( e) => panic ! ( "Got unexpected error when initializing: {e}" ) ,
14091409 Ok ( ( ) ) => panic ! ( "Initializing twice should not have been allowed" ) ,
14101410 }
14111411}
@@ -1517,7 +1517,7 @@ fn ro_rw_session_test() -> TestResult {
15171517 if let Error :: Pkcs11 ( RvError :: SessionReadOnly , _f) = e {
15181518 // as expected
15191519 } else {
1520- panic ! ( "Got wrong error code (expecting SessionReadOnly): {}" , e ) ;
1520+ panic ! ( "Got wrong error code (expecting SessionReadOnly): {e}" ) ;
15211521 }
15221522 ro_session. logout ( ) ?;
15231523 }
@@ -2163,8 +2163,7 @@ fn wait_for_slot_event() {
21632163 Function :: WaitForSlotEvent
21642164 ) )
21652165 ) ,
2166- "res = {:?}" ,
2167- res
2166+ "res = {res:?}"
21682167 ) ;
21692168}
21702169
0 commit comments