Frameworks like Actix-web and Rocket support writing routes like this:

#[get("/users/{id}")]
async fn show(id: web::Path<i32>) -> impl Responder { /* ... */ }

Many people think this is “elegant” — an attribute macro sits right above the function, and the path, method, and parameters are all visible at a glance, much like Spring MVC’s @GetMapping or FastAPI’s @app.get. Every so often someone files a Salvo issue asking: can we have a #[get] too?

Salvo deliberately doesn’t. This article tries to seriously explain the reasoning behind that decision.

阅读全文