Skip to content

Commit d39affb

Browse files
committed
Fix fmt panic at statement (rust-lang/rust#77774)
1 parent 54a55c4 commit d39affb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/actix_web_path_segement_params.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use actix_web::{get, test, web, App, HttpRequest, HttpResponse};
44
fn path_segment_param(req: HttpRequest, path: web::Path<(u32,)>) -> HttpResponse {
55
// uri: /user/123, path: None, skip: 9, segments: [("id", Segment(6, 9))]
66
dbg!(req.clone());
7-
println!("path.0 = {}", path.0.0);
7+
let user_id: u32 = path.into_inner().0;
8+
println!("path = {}", user_id);
89
println!("&req.match_info()[\"id\"] = {}", &req.match_info()["id"]);
910
println!(
1011
"req.match_info().query(\"id\") = {}",
@@ -14,7 +15,7 @@ fn path_segment_param(req: HttpRequest, path: web::Path<(u32,)>) -> HttpResponse
1415
"req.match_info().get(\"id\").unwrap() = {}",
1516
req.match_info().get("id").unwrap()
1617
);
17-
HttpResponse::Ok().body("asdf")
18+
HttpResponse::Ok().body("ok")
1819
}
1920

2021
async fn test_path_segment_param() {

0 commit comments

Comments
 (0)