mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
Use captured args in format string (#558)
This commit is contained in:
@ -59,7 +59,7 @@ async fn step_x(data: SomeData, client: &Client) -> actix_web::Result<SomeData>
|
||||
|
||||
let body: HttpBinResponse = serde_json::from_slice(&body).unwrap();
|
||||
|
||||
println!("{:?}", body);
|
||||
println!("{body:?}");
|
||||
|
||||
Ok(body.json)
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ async fn index(item: web::Json<MyObj>) -> HttpResponse {
|
||||
|
||||
/// This handler uses json extractor with limit
|
||||
async fn extract_item(item: web::Json<MyObj>, req: HttpRequest) -> HttpResponse {
|
||||
println!("request: {:?}", req);
|
||||
println!("model: {:?}", item);
|
||||
println!("request: {req:?}");
|
||||
println!("model: {item:?}");
|
||||
|
||||
HttpResponse::Ok().json(item.0) // <- send json response
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ async fn rpc_select(
|
||||
.await
|
||||
{
|
||||
Ok(ok) => Ok(Value::from(ok)),
|
||||
Err(e) => Err(convention::ErrorData::new(500, &format!("{:?}", e)[..])),
|
||||
Err(e) => Err(convention::ErrorData::new(500, &format!("{e:?}")[..])),
|
||||
}
|
||||
}
|
||||
"get" => {
|
||||
|
Reference in New Issue
Block a user