Skip to content

Commit

Permalink
Fix fmt panic at statement (rust-lang/rust#77774)
Browse files Browse the repository at this point in the history
  • Loading branch information
pymongo committed Oct 12, 2020
1 parent 54a55c4 commit d39affb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/actix_web_path_segement_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use actix_web::{get, test, web, App, HttpRequest, HttpResponse};
fn path_segment_param(req: HttpRequest, path: web::Path<(u32,)>) -> HttpResponse {
// uri: /user/123, path: None, skip: 9, segments: [("id", Segment(6, 9))]
dbg!(req.clone());
println!("path.0 = {}", path.0.0);
let user_id: u32 = path.into_inner().0;
println!("path = {}", user_id);
println!("&req.match_info()[\"id\"] = {}", &req.match_info()["id"]);
println!(
"req.match_info().query(\"id\") = {}",
Expand All @@ -14,7 +15,7 @@ fn path_segment_param(req: HttpRequest, path: web::Path<(u32,)>) -> HttpResponse
"req.match_info().get(\"id\").unwrap() = {}",
req.match_info().get("id").unwrap()
);
HttpResponse::Ok().body("asdf")
HttpResponse::Ok().body("ok")
}

async fn test_path_segment_param() {
Expand Down

0 comments on commit d39affb

Please sign in to comment.