1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

Make web::Path a tuple struct with a public inner value (#1594)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Jonas Platte
2020-07-21 01:54:26 +02:00
committed by GitHub
parent 43c362779d
commit f8d5ad6b53
5 changed files with 55 additions and 33 deletions

View File

@ -61,8 +61,8 @@ Code:
use actix_web::{get, web, App, HttpServer, Responder};
#[get("/{id}/{name}/index.html")]
async fn index(info: web::Path<(u32, String)>) -> impl Responder {
format!("Hello {}! id:{}", info.1, info.0)
async fn index(web::Path((id, name)): web::Path<(u32, String)>) -> impl Responder {
format!("Hello {}! id:{}", name, id)
}
#[actix_web::main]