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:
@ -36,7 +36,7 @@ async fn get_user(
|
||||
if let Some(user) = user {
|
||||
Ok(HttpResponse::Ok().json(user))
|
||||
} else {
|
||||
let res = HttpResponse::NotFound().body(format!("No user found with uid: {}", user_uid));
|
||||
let res = HttpResponse::NotFound().body(format!("No user found with uid: {user_uid}"));
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ async fn get_user(client: web::Data<Client>, username: web::Path<String>) -> Htt
|
||||
{
|
||||
Ok(Some(user)) => HttpResponse::Ok().json(user),
|
||||
Ok(None) => {
|
||||
HttpResponse::NotFound().body(format!("No user found with username {}", username))
|
||||
HttpResponse::NotFound().body(format!("No user found with username {username}"))
|
||||
}
|
||||
Err(err) => HttpResponse::InternalServerError().body(err.to_string()),
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ async fn del_stuff(redis: web::Data<Addr<RedisActor>>) -> actix_web::Result<Http
|
||||
}
|
||||
|
||||
_ => {
|
||||
log::error!("{:?}", res);
|
||||
log::error!("{res:?}");
|
||||
Ok(HttpResponse::InternalServerError().finish())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user