@@ -345,7 +345,7 @@ mod tests {
345345 SeLinuxError :: SELinuxNotEnabled => {
346346 // This is the expected error when SELinux is not enabled
347347 }
348- err => panic ! ( "Expected SELinuxNotEnabled error but got: {}" , err ) ,
348+ err => panic ! ( "Expected SELinuxNotEnabled error but got: {err}" ) ,
349349 }
350350 return ;
351351 }
@@ -372,8 +372,7 @@ mod tests {
372372
373373 assert ! (
374374 new_context. contains( "tmp_t" ) ,
375- "Expected context to contain 'tmp_t', but got: {}" ,
376- new_context
375+ "Expected context to contain 'tmp_t', but got: {new_context}"
377376 ) ;
378377 } else {
379378 println ! (
@@ -425,7 +424,7 @@ mod tests {
425424
426425 if result. is_ok ( ) {
427426 let context = result. unwrap ( ) ;
428- println ! ( "Retrieved SELinux context: {}" , context ) ;
427+ println ! ( "Retrieved SELinux context: {context}" ) ;
429428
430429 assert ! (
431430 is_selinux_enabled( ) ,
@@ -435,8 +434,7 @@ mod tests {
435434 if !context. is_empty ( ) {
436435 assert ! (
437436 context. contains( ':' ) ,
438- "SELinux context '{}' doesn't match expected format" ,
439- context
437+ "SELinux context '{context}' doesn't match expected format"
440438 ) ;
441439 }
442440 } else {
@@ -455,25 +453,24 @@ mod tests {
455453 "Got ContextRetrievalFailure when SELinux is not enabled"
456454 ) ;
457455 assert ! ( !e. is_empty( ) , "Error message should not be empty" ) ;
458- println ! ( "Context retrieval failure: {}" , e ) ;
456+ println ! ( "Context retrieval failure: {e}" ) ;
459457 }
460458 SeLinuxError :: ContextConversionFailure ( ctx, e) => {
461459 assert ! (
462460 is_selinux_enabled( ) ,
463461 "Got ContextConversionFailure when SELinux is not enabled"
464462 ) ;
465463 assert ! ( !e. is_empty( ) , "Error message should not be empty" ) ;
466- println ! ( "Context conversion failure for '{}': {}" , ctx , e ) ;
464+ println ! ( "Context conversion failure for '{ctx }': {e}" ) ;
467465 }
468466 SeLinuxError :: ContextSetFailure ( ctx, e) => {
469467 assert ! ( !e. is_empty( ) , "Error message should not be empty" ) ;
470- println ! ( "Context conversion failure for '{}': {}" , ctx , e ) ;
468+ println ! ( "Context conversion failure for '{ctx }': {e}" ) ;
471469 }
472470 SeLinuxError :: FileOpenFailure ( e) => {
473471 assert ! (
474472 Path :: new( path) . exists( ) ,
475- "File open failure occurred despite file being created: {}" ,
476- e
473+ "File open failure occurred despite file being created: {e}"
477474 ) ;
478475 }
479476 }
@@ -618,10 +615,10 @@ mod tests {
618615 if let Err ( err) = result {
619616 match err {
620617 SeLinuxError :: ContextSetFailure ( _, _) => {
621- println ! ( "Note: Could not set context due to permissions: {}" , err ) ;
618+ println ! ( "Note: Could not set context due to permissions: {err}" ) ;
622619 }
623620 unexpected => {
624- panic ! ( "Unexpected error: {}" , unexpected ) ;
621+ panic ! ( "Unexpected error: {unexpected}" ) ;
625622 }
626623 }
627624 }
0 commit comments