1
0
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:
Yuri Astrakhan
2022-06-07 22:53:38 -04:00
committed by GitHub
parent 912de4aa46
commit db5f00e771
37 changed files with 57 additions and 60 deletions

View File

@ -41,7 +41,7 @@ async fn main() -> std::io::Result<()> {
.wrap_fn(|sreq, srv| {
let host = sreq.connection_info().host().to_owned();
let uri = sreq.uri().to_owned();
let url = format!("https://{}{}", host, uri);
let url = format!("https://{host}{uri}");
// If the scheme is "https" then it will let other services below this wrap_fn
// handle the request and if it's "http" then a response with redirect status code

View File

@ -58,7 +58,7 @@ where
body.extend_from_slice(&chunk?);
}
println!("request body: {:?}", body);
println!("request body: {body:?}");
let res = svc.call(req).await?;
println!("response: {:?}", res.headers());