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

@ -10,12 +10,12 @@ use actix_web::{middleware::Logger, web, App, HttpRequest, HttpServer, Result};
/// simple index handler with session
async fn index(session: Session, req: HttpRequest) -> Result<&'static str> {
log::info!("{:?}", req);
log::info!("{req:?}");
// RequestSession trait is used for session access
let mut counter = 1;
if let Some(count) = session.get::<i32>("counter")? {
log::info!("SESSION value: {}", count);
log::info!("SESSION value: {count}");
counter = count + 1;
session.insert("counter", counter)?;
} else {