Repository: actix/actix-web (language: rust)

Issue:
Services macro breaks on format due to comments
## Expected Behavior
In a semi-specific situation, formatting the code should not break the `services!` macro.

## Current Behavior
The code below compiles, but errors after the formatter is run.

## Possible Solution
(Allow empty statements in the macro? I'm not sure.)
For now, people that are affected by this problem should move the second comment somewhere else. 

## Steps to Reproduce (for bugs)
Save the following code:

``` Rust
use actix_web::{services, web, HttpResponse};

fn main() {
    
        let services = services![
            web::scope("/test")
                .route("/test2", web::get().to(|| HttpResponse::NotFound())) // A quite short comment here.
                ,
                // Another comment here.
        ];
}
```
`cargo run` => it runs
`cargo fmt && cargo run`  => it errors

## Context, Environment
None, the example works in a minimal sandbox

- Rust Version (I.e, output of `rustc -V`): rustc 1.81.0 (eeb90cda1 2024-09-04)
- Actix Web Version: 4.9.0



Discussion / hints:

Fix patch:
diff --git a/actix-web/src/service.rs b/actix-web/src/service.rs
index a1672eba262..6c7f6f5c80a 100644
--- a/actix-web/src/service.rs
+++ b/actix-web/src/service.rs
@@ -662,6 +662,7 @@ where
 /// ```
 #[macro_export]
 macro_rules! services {
+    () => {()};
     ($($x:expr),+ $(,)?) => {
         ($($x,)+)
     }
@@ -870,4 +871,40 @@ mod tests {
         let req = test::TestRequest::default().to_request();
         let _res = test::call_service(&app, req).await;
     }
+
+    #[test]
+    fn define_services_macro_with_multiple_arguments() {
+        let result = services!(1, 2, 3);
+        assert_eq!(result, (1, 2, 3));
+    }
+
+    #[test]
+    fn define_services_macro_with_single_argument() {
+        let result = services!(1);
+        assert_eq!(result, (1,));
+    }
+
+    #[test]
+    fn define_services_macro_with_no_arguments() {
+        let result = services!();
+        let () = result;
+    }
+
+    #[test]
+    fn define_services_macro_with_trailing_comma() {
+        let result = services!(1, 2, 3,);
+        assert_eq!(result, (1, 2, 3));
+    }
+
+    #[test]
+    fn define_services_macro_with_comments_in_arguments() {
+        let result = services!(
+            1, // First comment
+            2, // Second comment
+            3  // Third comment
+        );
+
+        // Assert that comments are ignored and it correctly returns a tuple.
+        assert_eq!(result, (1, 2, 3));
+    }
 }


Test patch: