mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
upgrade actix min version
This commit is contained in:
parent
7fc7d6e17a
commit
e05596b65d
@ -73,7 +73,7 @@ tokio-tls = { version="0.1", optional = true }
|
|||||||
tokio-openssl = { version="0.1", optional = true }
|
tokio-openssl = { version="0.1", optional = true }
|
||||||
|
|
||||||
[dependencies.actix]
|
[dependencies.actix]
|
||||||
version = "^0.3.1"
|
version = "^0.3.4"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = []
|
features = []
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@ path = "src/main.rs"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
env_logger = "*"
|
env_logger = "*"
|
||||||
futures = "0.1"
|
futures = "0.1"
|
||||||
actix = "^0.3.1"
|
actix = "^0.3.4"
|
||||||
actix-web = { git = "https://github.com/actix/actix-web.git" }
|
actix-web = { git = "https://github.com/actix/actix-web.git" }
|
||||||
|
@ -4,6 +4,7 @@ extern crate actix_web;
|
|||||||
extern crate env_logger;
|
extern crate env_logger;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
|
|
||||||
|
use actix::*;
|
||||||
use actix_web::*;
|
use actix_web::*;
|
||||||
use futures::{Future, Stream};
|
use futures::{Future, Stream};
|
||||||
use futures::future::{result, Either};
|
use futures::future::{result, Either};
|
||||||
@ -28,7 +29,7 @@ fn index(mut req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>>
|
|||||||
.map(|chunk| {
|
.map(|chunk| {
|
||||||
println!("-- CHUNK: \n{}",
|
println!("-- CHUNK: \n{}",
|
||||||
std::str::from_utf8(&chunk).unwrap());})
|
std::str::from_utf8(&chunk).unwrap());})
|
||||||
.fold((), |_, _| result::<_, Error>(Ok(()))))
|
.finish())
|
||||||
},
|
},
|
||||||
multipart::MultipartItem::Nested(mp) => {
|
multipart::MultipartItem::Nested(mp) => {
|
||||||
// Or item could be nested Multipart stream
|
// Or item could be nested Multipart stream
|
||||||
@ -36,8 +37,7 @@ fn index(mut req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// wait until stream finishes
|
.finish() // <- Stream::finish() combinator from actix
|
||||||
.fold((), |_, _| result::<_, Error>(Ok(())))
|
|
||||||
.map(|_| httpcodes::HTTPOk.response())
|
.map(|_| httpcodes::HTTPOk.response())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user