mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
Unify route macros (#1705)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
error: HTTP Method defined more than once: `GET`
|
||||
error: HTTP method defined more than once: `GET`
|
||||
--> $DIR/route-duplicate-method-fail.rs:3:35
|
||||
|
|
||||
3 | #[route("/", method="GET", method="GET")]
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: Unexpected HTTP Method: `UNEXPECTED`
|
||||
error: Unexpected HTTP method: `UNEXPECTED`
|
||||
--> $DIR/route-unexpected-method-fail.rs:3:21
|
||||
|
|
||||
3 | #[route("/", method="UNEXPECTED")]
|
||||
|
@ -22,4 +22,9 @@ async fn four() -> impl Responder {
|
||||
HttpResponse::Ok()
|
||||
}
|
||||
|
||||
#[delete("/five", method="GET")]
|
||||
async fn five() -> impl Responder {
|
||||
HttpResponse::Ok()
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -21,3 +21,9 @@ error: Multiple paths specified! Should be only one!
|
||||
|
|
||||
20 | #[delete("/four", "/five")]
|
||||
| ^^^^^^^
|
||||
|
||||
error: HTTP method forbidden here. To handle multiple methods, use `route` instead
|
||||
--> $DIR/simple-fail.rs:25:19
|
||||
|
|
||||
25 | #[delete("/five", method="GET")]
|
||||
| ^^^^^^^^^^^^
|
||||
|
Reference in New Issue
Block a user