mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 09:59:21 +02:00
cleanup and optimize some code
This commit is contained in:
@ -13,9 +13,11 @@ use futures::future::{FutureResult, result};
|
||||
/// simple handler
|
||||
fn index(mut req: HttpRequest) -> Result<HttpResponse> {
|
||||
println!("{:?}", req);
|
||||
if let Ok(ch) = req.payload_mut().readany() {
|
||||
if let futures::Async::Ready(Some(d)) = ch {
|
||||
println!("{}", String::from_utf8_lossy(d.0.as_ref()));
|
||||
if let Some(payload) = req.payload_mut() {
|
||||
if let Ok(ch) = payload.readany() {
|
||||
if let futures::Async::Ready(Some(d)) = ch {
|
||||
println!("{}", String::from_utf8_lossy(d.0.as_ref()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user