mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
upgrade to beta3
This commit is contained in:
@ -10,7 +10,7 @@ name = "multipart"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.3"
|
||||
actix-multipart = "0.1.0-beta.1"
|
||||
|
||||
env_logger = "0.6"
|
||||
|
@ -23,11 +23,10 @@ pub fn save_file(field: Field) -> impl Future<Item = i64, Error = Error> {
|
||||
// fs operations are blocking, we have to execute writes
|
||||
// on threadpool
|
||||
web::block(move || {
|
||||
file.write_all(bytes.as_ref())
|
||||
.map_err(|e| {
|
||||
println!("file.write_all failed: {:?}", e);
|
||||
MultipartError::Payload(error::PayloadError::Io(e))
|
||||
})?;
|
||||
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))
|
||||
})
|
||||
|
Reference in New Issue
Block a user