@@ -332,7 +332,8 @@ async fn validate_single_email(
332332 status : None ,
333333 error : Some ( EmailValidationError {
334334 code : "DISPOSABLE_EMAIL" . to_string ( ) ,
335- message : "The email address domain is a provider of disposable email addresses" . to_string ( ) ,
335+ message : "The email address domain is a provider of disposable email addresses"
336+ . to_string ( ) ,
336337 } ) ,
337338 } ,
338339 Ok ( false ) => EmailValidationResponse {
@@ -398,7 +399,8 @@ pub async fn validate_emails_bulk(
398399 let redis_cache = redis_cache. get_ref ( ) . clone ( ) ;
399400 let check_role_based = query. check_role_based ;
400401 async move {
401- let validation = validate_single_email ( & email_clone, check_role_based, & redis_cache) . await ;
402+ let validation =
403+ validate_single_email ( & email_clone, check_role_based, & redis_cache) . await ;
402404 ( email_clone, validation)
403405 }
404406 } )
@@ -654,7 +656,7 @@ mod tests {
654656
655657 let body = test:: read_body ( resp) . await ;
656658 let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
657-
659+
658660 assert ! ( body_json[ "results" ] . is_array( ) ) ;
659661 assert_eq ! ( body_json[ "results" ] . as_array( ) . unwrap( ) . len( ) , 2 ) ;
660662 assert ! ( body_json[ "valid_count" ] . is_number( ) ) ;
@@ -676,10 +678,10 @@ mod tests {
676678
677679 let body = test:: read_body ( resp) . await ;
678680 let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
679-
681+
680682 let results = body_json[ "results" ] . as_array ( ) . unwrap ( ) ;
681683 assert_eq ! ( results. len( ) , 3 ) ;
682-
684+
683685 // Check that we have both valid and invalid results
684686 let valid_count = body_json[ "valid_count" ] . as_i64 ( ) . unwrap ( ) ;
685687 let invalid_count = body_json[ "invalid_count" ] . as_i64 ( ) . unwrap ( ) ;
@@ -702,7 +704,7 @@ mod tests {
702704
703705 let body = test:: read_body ( resp) . await ;
704706 let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
705-
707+
706708 let results = body_json[ "results" ] . as_array ( ) . unwrap ( ) ;
707709 assert_eq ! ( results. len( ) , 2 ) ;
708710 }
@@ -720,7 +722,7 @@ mod tests {
720722
721723 let body = test:: read_body ( resp) . await ;
722724 let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
723-
725+
724726 assert_eq ! ( body_json[ "results" ] . as_array( ) . unwrap( ) . len( ) , 0 ) ;
725727 assert_eq ! ( body_json[ "valid_count" ] , 0 ) ;
726728 assert_eq ! ( body_json[ "invalid_count" ] , 0 ) ;
@@ -741,27 +743,30 @@ mod tests {
741743
742744 let body = test:: read_body ( resp) . await ;
743745 let body_json: serde_json:: Value = serde_json:: from_slice ( & body) . unwrap ( ) ;
744-
746+
745747 let results = body_json[ "results" ] . as_array ( ) . unwrap ( ) ;
746-
748+
747749 // Find the disposable email result
748750 let disposable_result = results
749751 . iter ( )
750752 . find ( |r| r[ "email" ] == "user@mailinator.com" )
751753 . unwrap ( ) ;
752-
754+
753755 assert_eq ! ( disposable_result[ "validation" ] [ "is_valid" ] , false ) ;
754- assert_eq ! ( disposable_result[ "validation" ] [ "error" ] [ "code" ] , "DISPOSABLE_EMAIL" ) ;
756+ assert_eq ! (
757+ disposable_result[ "validation" ] [ "error" ] [ "code" ] ,
758+ "DISPOSABLE_EMAIL"
759+ ) ;
755760 }
756761
757762 #[ actix_web:: test]
758763 async fn test_validate_single_email_function ( ) {
759764 let redis_cache = RedisCache :: test_dummy ( ) ;
760-
765+
761766 // Test valid email
762767 let result = validate_single_email ( "test@example.com" , false , & redis_cache) . await ;
763768 assert ! ( result. is_valid || !result. is_valid) ; // Either outcome is valid for this test
764-
769+
765770 // Test invalid syntax
766771 let result = validate_single_email ( "invalid-email" , false , & redis_cache) . await ;
767772 assert ! ( !result. is_valid) ;
0 commit comments