diff --git a/multipart/src/main.rs b/multipart/src/main.rs index aa3c8b97..da7b929a 100644 --- a/multipart/src/main.rs +++ b/multipart/src/main.rs @@ -23,13 +23,12 @@ pub fn save_file(field: Field) -> impl Future { // fs operations are blocking, we have to execute writes // on threadpool web::block(move || { - acc += file - .write_all(bytes.as_ref()) - .map(|_| acc + bytes.len() as i64) + file.write_all(bytes.as_ref()) .map_err(|e| { println!("file.write_all failed: {:?}", e); MultipartError::Payload(error::PayloadError::Io(e)) })?; + acc += bytes.len() as i64; Ok((file, acc)) }) .map_err(|e: error::BlockingError| {