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:
@ -14,7 +14,7 @@ async fn save_file(mut payload: Multipart) -> Result<HttpResponse, Error> {
|
||||
let filename = content_disposition
|
||||
.get_filename()
|
||||
.map_or_else(|| Uuid::new_v4().to_string(), sanitize_filename::sanitize);
|
||||
let filepath = format!("./tmp/{}", filename);
|
||||
let filepath = format!("./tmp/{filename}");
|
||||
|
||||
// File::create is blocking operation, use threadpool
|
||||
let mut f = web::block(|| std::fs::File::create(filepath)).await??;
|
||||
|
Reference in New Issue
Block a user